Skip to content

Commit c0da0ea

Browse files
committed
Move fixtures to tests folder
1 parent 1e027d2 commit c0da0ea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: etc/kayobe/ansible/scripts/test_smartmon.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
def load_json_fixture(filename):
1818
"""
19-
Load a JSON file from the 'drives' subfolder.
19+
Load a JSON file from the 'tests' subfolder.
2020
"""
21-
path = os.path.join(os.path.dirname(__file__), "drives", filename)
21+
path = os.path.join(os.path.dirname(__file__), "tests", filename)
2222
with open(path, "r", encoding="utf-8") as f:
2323
return json.load(f)
2424

2525

2626
class TestSmartMon(unittest.TestCase):
2727
@classmethod
2828
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")
3131
cls.fixture_files = glob.glob(os.path.join(data_folder, "*.json"))
3232

3333
def create_mock_device_from_json(self, device_info, if_attributes=None):
@@ -133,7 +133,7 @@ def _test_parse_device_info(self, fixture_name):
133133

134134
def test_parse_device_info(self):
135135
"""
136-
Test parse_device_info() for every JSON fixture in ./drives/.
136+
Test parse_device_info() for every JSON fixture in ./tests/.
137137
Each fixture is tested individually with clear error reporting.
138138
"""
139139
for fixture_path in self.fixture_files:
@@ -194,7 +194,7 @@ def _test_parse_if_attributes(self, fixture_name):
194194

195195
def test_parse_if_attributes(self):
196196
"""
197-
Test parse_if_attributes() for every JSON fixture in ./drives/.
197+
Test parse_if_attributes() for every JSON fixture in ./tests/.
198198
Each fixture is tested individually with clear error reporting.
199199
"""
200200
for fixture_path in self.fixture_files:
@@ -206,7 +206,7 @@ def test_parse_if_attributes(self):
206206
@patch("smartmon.DeviceList")
207207
def test_main(self, mock_devicelist_class, mock_run_cmd):
208208
"""
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/.
210210
This ensures we can handle multiple disks (multiple fixture files).
211211
"""
212212
for fixture_path in self.fixture_files:

0 commit comments

Comments
 (0)