Skip to content

Commit

Permalink
Add test for archives as inspect_manifest input
Browse files Browse the repository at this point in the history
Reference: #1034
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
  • Loading branch information
AyanSinhaMahapatra committed Dec 22, 2023
1 parent 6428a4d commit fd3c8ba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Binary file not shown.
22 changes: 19 additions & 3 deletions scanpipe/tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,9 @@ def test_scanpipe_inspect_manifest_pipeline_integration(self):
self.assertEqual(1, project1.projectmessages.count())
message = project1.projectmessages.get()
self.assertEqual("get_packages_from_manifest", message.model)
expected = ("No manifests found for resolving packages")
expected = "No manifests found for resolving packages"
self.assertIn(expected, message.description)

def test_scanpipe_inspect_manifest_pipeline_integration_empty_manifest(self):
pipeline_name = "inspect_manifest"
project1 = Project.objects.create(name="Analysis")
Expand All @@ -811,9 +811,25 @@ def test_scanpipe_inspect_manifest_pipeline_integration_empty_manifest(self):
self.assertEqual(1, project1.projectmessages.count())
message = project1.projectmessages.get()
self.assertEqual("get_packages_from_manifest", message.model)
expected = ("No packages could be resolved for")
expected = "No packages could be resolved for"
self.assertIn(expected, message.description)

def test_scanpipe_inspect_manifest_pipeline_integration_misc(self):
pipeline_name = "inspect_manifest"
project1 = Project.objects.create(name="Analysis")

input_location = (
self.data_location / "manifests" / "python-inspector-0.10.0.zip"
)
project1.copy_input_from(input_location)

run = project1.add_pipeline(pipeline_name)
pipeline = run.make_pipeline_instance()

exitcode, out = pipeline.execute()
self.assertEqual(0, exitcode, msg=out)
self.assertEqual(26, project1.discoveredpackages.count())

@mock.patch("scanpipe.pipes.resolve.resolve_dependencies")
def test_scanpipe_inspect_manifest_pipeline_pypi_integration(
self, resolve_dependencies
Expand Down

0 comments on commit fd3c8ba

Please sign in to comment.