Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <jyang@nexb.com>
  • Loading branch information
JonoYang committed Aug 8, 2023
1 parent eb6f250 commit 7c0ce60
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packagedb/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ def setUp(self):

def test_reindex_package(self):
self.assertEqual(False, self.scannableuri.rescan_uri)
self.assertEqual(0, self.scannableuri.priority)
self.assertEqual(self.scan_uuid, self.scannableuri.scan_uuid)
self.assertEqual('error', self.scannableuri.scan_error)
self.assertEqual('error', self.scannableuri.index_error)
Expand All @@ -528,19 +529,22 @@ def test_reindex_package(self):
self.assertEqual('pkg:maven/sample/baz@90.12 has been queued for reindexing', response.data['status'])
self.scannableuri.refresh_from_db()
self.assertEqual(True, self.scannableuri.rescan_uri)
self.assertEqual(100, self.scannableuri.priority)
self.assertEqual(None, self.scannableuri.scan_uuid)
self.assertEqual(None, self.scannableuri.scan_error)
self.assertEqual(None, self.scannableuri.index_error)
self.assertEqual(None, self.scannableuri.scan_request_date)

def test_reindex_packages_basic(self):
self.assertEqual(False, self.scannableuri.rescan_uri)
self.assertEqual(0, self.scannableuri.priority)
self.assertEqual(self.scan_uuid, self.scannableuri.scan_uuid)
self.assertEqual('error', self.scannableuri.scan_error)
self.assertEqual('error', self.scannableuri.index_error)
self.assertEqual(self.scan_request_date, self.scannableuri.scan_request_date)

self.assertEqual(False, self.scannableuri2.rescan_uri)
self.assertEqual(0, self.scannableuri2.priority)
self.assertEqual(self.scan_uuid2, self.scannableuri2.scan_uuid)
self.assertEqual('error', self.scannableuri2.scan_error)
self.assertEqual('error', self.scannableuri2.index_error)
Expand All @@ -563,13 +567,15 @@ def test_reindex_packages_basic(self):

self.scannableuri.refresh_from_db()
self.assertEqual(True, self.scannableuri.rescan_uri)
self.assertEqual(100, self.scannableuri.priority)
self.assertEqual(None, self.scannableuri.scan_uuid)
self.assertEqual(None, self.scannableuri.scan_error)
self.assertEqual(None, self.scannableuri.index_error)
self.assertEqual(None, self.scannableuri.scan_request_date)

self.scannableuri2.refresh_from_db()
self.assertEqual(True, self.scannableuri2.rescan_uri)
self.assertEqual(100, self.scannableuri.priority)
self.assertEqual(None, self.scannableuri2.scan_uuid)
self.assertEqual(None, self.scannableuri2.scan_error)
self.assertEqual(None, self.scannableuri2.index_error)
Expand Down

0 comments on commit 7c0ce60

Please sign in to comment.