Skip to content

Commit

Permalink
Migrate tests from #1091 to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
ethho committed Sep 12, 2024
1 parent 5948a41 commit 80a04c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_blob_matlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def insert_blobs(schema):

schema.connection.query(
"""
INSERT INTO {table_name} VALUES
INSERT INTO {table_name} (`id`, `comment`, `blob`) VALUES
(1,'simple string',0x6D596D00410200000000000000010000000000000010000000000000000400000000000000630068006100720061006300740065007200200073007400720069006E006700),
(2,'1D vector',0x6D596D0041020000000000000001000000000000000C000000000000000600000000000000000000000000F03F00000000000030400000000000003F4000000000000047400000000000804E4000000000000053400000000000C056400000000000805A400000000000405E4000000000000061400000000000E062400000000000C06440),
(3,'string array',0x6D596D00430200000000000000010000000000000002000000000000002F0000000000000041020000000000000001000000000000000700000000000000040000000000000073007400720069006E00670031002F0000000000000041020000000000000001000000000000000700000000000000040000000000000073007400720069006E0067003200),
Expand Down
15 changes: 15 additions & 0 deletions tests/test_declare.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,18 @@ class Table_With_Underscores(dj.Manual):
dj.DataJointError, match="must be alphanumeric in CamelCase"
) as e:
schema_any(Table_With_Underscores)


def test_hidden_attributes(schema_any):
assert (
list(Experiment().heading._attributes.keys())[-1].split("_")[2]
== "timestamp"
)
assert (
len([a for a in Experiment().heading._attributes.values() if a.is_hidden])
!= 0
)
assert (
len([a for a in Experiment().heading.attributes.values() if a.is_hidden])
== 0
)

0 comments on commit 80a04c4

Please sign in to comment.