Skip to content

Commit

Permalink
refactored test case
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Gupta <abhng@amazon.com>
  • Loading branch information
abhinavGupta16 committed Dec 21, 2021
1 parent 9cb944c commit eed9b7f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/tests_sign_workflow/test_sign_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ class TestSignArtifacts(unittest.TestCase):
@patch("sign_workflow.signer.GitRepository")
@patch("sign_workflow.signer.Signer", return_value=MagicMock())
def test_from_path_method(self, mock_signer, *mocks):
path = Path(r"/dummy/path/manifest.yml")
component = 'maven'
artifact_type = 'dummy'
sigtype = '.asc'

klass = SignArtifacts.from_path(path, component, artifact_type, sigtype, mock_signer)
klass = SignArtifacts.from_path(Path(r"/dummy/path/manifest.yml"), component, artifact_type, sigtype, mock_signer)
self.assertEqual(type(SignWithBuildManifest), type(klass.__class__))

path = Path(r"/dummy/path/")
klass = SignArtifacts.from_path(path, component, artifact_type, sigtype, mock_signer)
klass = SignArtifacts.from_path(Path(os.path.dirname(__file__)), component, artifact_type, sigtype, mock_signer)
self.assertEqual(type(SignExistingArtifactsDir), type(klass.__class__))

path = Path(r"/dummy/path/artifact.tar.gz")
klass = SignArtifacts.from_path(path, component, artifact_type, sigtype, mock_signer)
klass = SignArtifacts.from_path(Path(r"/dummy/path/artifact.tar.gz"), component, artifact_type, sigtype, mock_signer)
self.assertEqual(type(SignArtifactsExistingArtifactFile), type(klass.__class__))

def test_signer_class(self):
Expand Down

0 comments on commit eed9b7f

Please sign in to comment.