()
| 250 | |
| 251 | |
| 252 | def create_tests(): |
| 253 | for dirpath, _, filenames in os.walk(SDAM_PATH): |
| 254 | dirname = os.path.split(dirpath)[-1] |
| 255 | # SDAM unified tests are handled separately. |
| 256 | if dirname == "unified": |
| 257 | continue |
| 258 | |
| 259 | for filename in filenames: |
| 260 | if os.path.splitext(filename)[1] != ".json": |
| 261 | continue |
| 262 | with open(os.path.join(dirpath, filename)) as scenario_stream: |
| 263 | scenario_def = json_util.loads(scenario_stream.read()) |
| 264 | |
| 265 | # Construct test from scenario. |
| 266 | new_test = create_test(scenario_def) |
| 267 | test_name = f"test_{dirname}_{os.path.splitext(filename)[0]}" |
| 268 | |
| 269 | new_test.__name__ = test_name |
| 270 | setattr(TestAllScenarios, new_test.__name__, new_test) |
| 271 | |
| 272 | |
| 273 | create_tests() |
no test coverage detected