Skip to content

Commit

Permalink
Fix failing test_purldb_toolkit_pick_purldb_entry #131
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jun 13, 2024
1 parent f004718 commit 0a6e923
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions purldb/tests/test_purldb_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ def test_purldb_toolkit_pick_purldb_entry(self):
purl1 = "pkg:type/[email protected]"
purl2 = "pkg:type/[email protected]"
purl3 = "pkg:type/[email protected]"
self.assertEqual(purl1, pick_purldb_entry([purl1]))
self.assertIsNone(purl1, pick_purldb_entry([purl1, purl2]))

self.assertEqual(purl1, pick_purldb_entry([purl1, purl2], purl=purl1))
self.assertEqual(purl2, pick_purldb_entry([purl1, purl2], purl=purl2))
self.assertIsNone(pick_purldb_entry([purl1, purl2], purl=purl3))
entry1 = {"purl": purl1}
entry2 = {"purl": purl2}

self.assertEqual(entry1, pick_purldb_entry([entry1]))
self.assertIsNone(pick_purldb_entry([entry1, entry2]))

self.assertEqual(entry1, pick_purldb_entry([entry1, entry2], purl=purl1))
self.assertEqual(entry2, pick_purldb_entry([entry1, entry2], purl=purl2))
self.assertIsNone(pick_purldb_entry([entry1, entry1], purl=purl1))
self.assertIsNone(pick_purldb_entry([entry1, entry2], purl=purl3))

0 comments on commit 0a6e923

Please sign in to comment.