|
12 | 12 |
|
13 | 13 | def test_read_invalid_extenstion(sample_data_txt: pathlib.Path) -> None: |
14 | 14 | """Test the read_watch_data function with an invalid file extension.""" |
15 | | - with pytest.raises(IOError): |
| 15 | + with pytest.raises(ValueError, match="File type .txt is not supported."): |
16 | 16 | readers.read_watch_data(sample_data_txt) |
17 | 17 |
|
18 | 18 |
|
@@ -42,7 +42,7 @@ def test_geneactiv_bin_loader(sample_data_bin: pathlib.Path) -> None: |
42 | 42 |
|
43 | 43 | def test_nonexistent_file() -> None: |
44 | 44 | """Test the correct error is raised for nonexistent file.""" |
45 | | - with pytest.raises(IOError): |
| 45 | + with pytest.raises(IOError, match="Error reading file:"): |
46 | 46 | readers.read_watch_data("nonexistent_file.gt3x") |
47 | 47 |
|
48 | 48 |
|
@@ -74,3 +74,23 @@ def test_extract_dynamic_range_gt3x(sample_data_gt3x: pathlib.Path) -> None: |
74 | 74 | assert ( |
75 | 75 | result == expected_dynamic_range |
76 | 76 | ), f"Expected dynamic range of: {expected_dynamic_range}, result was: {result}" |
| 77 | + |
| 78 | + |
| 79 | +def test_timezone_extraction_gt3x(sample_data_gt3x: pathlib.Path) -> None: |
| 80 | + """Test extracting timezone metadata from .gt3x files.""" |
| 81 | + expected_timezone = "-05:00:00" |
| 82 | + watch_data = readers.read_watch_data(sample_data_gt3x) |
| 83 | + |
| 84 | + assert ( |
| 85 | + watch_data.time_zone == expected_timezone |
| 86 | + ), f"Expected timezone of: {expected_timezone}, result was: {watch_data.time_zone}" |
| 87 | + |
| 88 | + |
| 89 | +def test_timezone_extraction_bin(sample_data_bin: pathlib.Path) -> None: |
| 90 | + """Test extracting timezone metadata from .bin files.""" |
| 91 | + expected_timezone = "-05:00" |
| 92 | + watch_data = readers.read_watch_data(sample_data_bin) |
| 93 | + |
| 94 | + assert ( |
| 95 | + watch_data.time_zone == expected_timezone |
| 96 | + ), f"Expected timezone of: {expected_timezone}, result was: {watch_data.time_zone}" |
0 commit comments