Coverage for tests/test_structs.py: 100%
20 statements
« prev ^ index » next coverage.py v7.0.2, created at 2023-01-03 12:07 -0800
« prev ^ index » next coverage.py v7.0.2, created at 2023-01-03 12:07 -0800
1from matplotlib.patches import Circle
2from numpy import tri
3from sleapyfaces.structs import CustomColumn, File, FileConstructor
4import pandas as pd
7def test_custom_columns():
8 cc = CustomColumn("Mouse", "CSE008")
9 assert cc.ColumnTitle == "Mouse"
10 assert cc.ColumnData == "CSE008"
11 cc.buildColumn(10)
12 assert type(cc.Column) is pd.DataFrame
15def test_files_constructor():
16 daq_file = File(
17 "/Users/annieehler/Projects/Jupyter_Notebooks/SLEAPyFaces/tests/data/20211105",
18 "DAQOutput.csv",
19 )
20 sleap_file = File(
21 "/Users/annieehler/Projects/Jupyter_Notebooks/SLEAPyFaces/tests/data/20211105",
22 "*.h5",
23 True,
24 )
25 beh_file = File(
26 "/Users/annieehler/Projects/Jupyter_Notebooks/SLEAPyFaces/tests/data/20211105",
27 "BehMetadata.json",
28 )
29 video_file = File(
30 "/Users/annieehler/Projects/Jupyter_Notebooks/SLEAPyFaces/tests/data/20211105",
31 "video.mp4",
32 )
33 assert (
34 daq_file.file
35 == "/Users/annieehler/Projects/Jupyter_Notebooks/SLEAPyFaces/tests/data/20211105/DAQOutput.csv"
36 )
37 assert (
38 sleap_file.file
39 == "/Users/annieehler/Projects/Jupyter_Notebooks/SLEAPyFaces/tests/data/20211105/SLEAP.h5"
40 )
41 fc = FileConstructor(daq_file, sleap_file, beh_file, video_file)
42 assert fc.daq == daq_file
43 assert fc.sleap == sleap_file