|
16 | 16 | ArtifactListFolderResponse, |
17 | 17 | ArtifactListResponse, |
18 | 18 | Checksums, |
19 | | - OriginalChecksums, |
20 | 19 | ) |
21 | 20 |
|
22 | 21 | URL = "http://localhost:8080/artifactory" |
|
77 | 76 | "md5": "4cf609e0fe1267df8815bc650f5851e9", |
78 | 77 | "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
79 | 78 | }, |
80 | | - "originalChecksums": {"sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858"}, |
| 79 | + "originalChecksums": { |
| 80 | + "sha1": "962c287c760e03b03c17eb920f5358d05f44dd3b", |
| 81 | + "md5": "4cf609e0fe1267df8815bc650f5851e9", |
| 82 | + "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
| 83 | + }, |
81 | 84 | "uri": f"{URL}/api/storage/{ARTIFACT_PATH}", |
82 | 85 | } |
83 | 86 | FILE_INFO = ArtifactFileInfoResponse(**FILE_INFO_RESPONSE) |
@@ -610,81 +613,6 @@ def test_checksum_defined_file(file_path: Path, expected_sha1: str, expected_md5 |
610 | 613 | assert result == expected |
611 | 614 |
|
612 | 615 |
|
613 | | -@pytest.mark.parametrize( |
614 | | - "file_info,expected_checksums", |
615 | | - [ |
616 | | - pytest.param( |
617 | | - { |
618 | | - **FILE_INFO_RESPONSE.copy(), |
619 | | - "originalChecksums": { |
620 | | - "md5": "4cf609e0fe1267df8815bc650f5851e9", |
621 | | - "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
622 | | - }, |
623 | | - }, |
624 | | - { |
625 | | - "md5": "4cf609e0fe1267df8815bc650f5851e9", |
626 | | - "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
627 | | - }, |
628 | | - id="md5", |
629 | | - ), |
630 | | - pytest.param( |
631 | | - { |
632 | | - **FILE_INFO_RESPONSE.copy(), |
633 | | - "originalChecksums": { |
634 | | - "sha1": "962c287c760e03b03c17eb920f5358d05f44dd3b", |
635 | | - "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
636 | | - }, |
637 | | - }, |
638 | | - { |
639 | | - "sha1": "962c287c760e03b03c17eb920f5358d05f44dd3b", |
640 | | - "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
641 | | - }, |
642 | | - id="sha1", |
643 | | - ), |
644 | | - pytest.param( |
645 | | - { |
646 | | - **FILE_INFO_RESPONSE.copy(), |
647 | | - "originalChecksums": {"sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858"}, |
648 | | - }, |
649 | | - {"sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858"}, |
650 | | - id="sha256", |
651 | | - ), |
652 | | - pytest.param( |
653 | | - { |
654 | | - **FILE_INFO_RESPONSE.copy(), |
655 | | - "originalChecksums": { |
656 | | - "md5": "4cf609e0fe1267df8815bc650f5851e9", |
657 | | - "sha1": "962c287c760e03b03c17eb920f5358d05f44dd3b", |
658 | | - "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
659 | | - }, |
660 | | - }, |
661 | | - { |
662 | | - "sha256": "396cf16e8ce000342c95ffc7feb2a15701d0994b70c1b13fea7112f85ac8e858", |
663 | | - "md5": "4cf609e0fe1267df8815bc650f5851e9", |
664 | | - "sha1": "962c287c760e03b03c17eb920f5358d05f44dd3b", |
665 | | - }, |
666 | | - id="md5&sha1", |
667 | | - ), |
668 | | - ], |
669 | | -) |
670 | | -@responses.activate |
671 | | -def test_deploy_artifact_with_checksum_algorithms_success(file_info: dict, expected_checksums: dict): |
672 | | - responses.add(responses.PUT, f"{URL}/{ARTIFACT_PATH}", status=200) |
673 | | - responses.add( |
674 | | - responses.GET, |
675 | | - f"{URL}/api/storage/{ARTIFACT_PATH}", |
676 | | - json=file_info, |
677 | | - status=200, |
678 | | - ) |
679 | | - expected = OriginalChecksums(**expected_checksums) |
680 | | - artifactory = ArtifactoryArtifact(AuthModel(url=URL, auth=AUTH)) |
681 | | - artifact = artifactory.deploy( |
682 | | - Path(LOCAL_FILE_LOCATION), |
683 | | - Path(ARTIFACT_PATH), |
684 | | - ) |
685 | | - assert expected == artifact.originalChecksums |
686 | | - |
687 | | - |
688 | 616 | @responses.activate |
689 | 617 | def test_deploy_artifact_with_checksum_success(mocker): |
690 | 618 | responses.add(responses.PUT, f"{URL}/{ARTIFACT_PATH}", status=200) |
|
0 commit comments