16
16
17
17
def load_json_fixture (filename ):
18
18
"""
19
- Load a JSON file from the 'drives ' subfolder.
19
+ Load a JSON file from the 'tests ' subfolder.
20
20
"""
21
- path = os .path .join (os .path .dirname (__file__ ), "drives " , filename )
21
+ path = os .path .join (os .path .dirname (__file__ ), "tests " , filename )
22
22
with open (path , "r" , encoding = "utf-8" ) as f :
23
23
return json .load (f )
24
24
25
25
26
26
class TestSmartMon (unittest .TestCase ):
27
27
@classmethod
28
28
def setUpClass (cls ):
29
- # Collect all *.json files from ./drives /
30
- data_folder = os .path .join (os .path .dirname (__file__ ), "drives " )
29
+ # Collect all *.json files from ./tests /
30
+ data_folder = os .path .join (os .path .dirname (__file__ ), "tests " )
31
31
cls .fixture_files = glob .glob (os .path .join (data_folder , "*.json" ))
32
32
33
33
def create_mock_device_from_json (self , device_info , if_attributes = None ):
@@ -133,7 +133,7 @@ def _test_parse_device_info(self, fixture_name):
133
133
134
134
def test_parse_device_info (self ):
135
135
"""
136
- Test parse_device_info() for every JSON fixture in ./drives /.
136
+ Test parse_device_info() for every JSON fixture in ./tests /.
137
137
Each fixture is tested individually with clear error reporting.
138
138
"""
139
139
for fixture_path in self .fixture_files :
@@ -194,7 +194,7 @@ def _test_parse_if_attributes(self, fixture_name):
194
194
195
195
def test_parse_if_attributes (self ):
196
196
"""
197
- Test parse_if_attributes() for every JSON fixture in ./drives /.
197
+ Test parse_if_attributes() for every JSON fixture in ./tests /.
198
198
Each fixture is tested individually with clear error reporting.
199
199
"""
200
200
for fixture_path in self .fixture_files :
@@ -206,7 +206,7 @@ def test_parse_if_attributes(self):
206
206
@patch ("smartmon.DeviceList" )
207
207
def test_main (self , mock_devicelist_class , mock_run_cmd ):
208
208
"""
209
- End-to-end test of main() for every JSON fixture in ./drives /.
209
+ End-to-end test of main() for every JSON fixture in ./tests /.
210
210
This ensures we can handle multiple disks (multiple fixture files).
211
211
"""
212
212
for fixture_path in self .fixture_files :
0 commit comments