(trajectory)
| 609 | assert is_valid |
| 610 | |
| 611 | def test_task_51(trajectory): |
| 612 | model_path = "./output/51.pkl" |
| 613 | |
| 614 | # Check if the file exists |
| 615 | if not os.path.exists(model_path): |
| 616 | raise FileNotFoundError(f"The file {model_path} does not exist.") |
| 617 | |
| 618 | # Load and validate the .pkl file |
| 619 | def load_and_validate_pkl(file_path): |
| 620 | try: |
| 621 | with open(file_path, 'rb') as file: |
| 622 | data = pickle.load(file) |
| 623 | #print("File loaded successfully. Data content:") |
| 624 | #print(data) |
| 625 | return True |
| 626 | except Exception as e: |
| 627 | #print(f"Failed to load the file: {e}") |
| 628 | return False |
| 629 | |
| 630 | # Validate the .pkl file |
| 631 | is_valid = load_and_validate_pkl(model_path) |
| 632 | |
| 633 | # Assert that the file is valid |
| 634 | assert is_valid |
| 635 | |
| 636 | def test_task_52(trajectory): |
| 637 | ans = "./output/52_neg.png" |
nothing calls this directly
no test coverage detected