Skip to content

Commit

Permalink
added unit test for cleanup_db
Browse files Browse the repository at this point in the history
 	modified:   adsdocmatch/tests/unittests/test_oracle_util.py
  • Loading branch information
seasidesparrow committed Aug 7, 2023
1 parent 0b1c1e3 commit 825e9a5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions adsdocmatch/tests/unittests/test_oracle_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,17 @@ def test_query(self):
# remove temp files
os.remove(tmp_output_filename)

def test_cleanup(self):
""" """
with mock.patch('requests.get') as mock_oracle_util:
mock_oracle_util.return_value = mock_response = mock.Mock()
mock_response.status_code = 200
result = self.match_metadata.ORACLE_UTIL.cleanup_db()
self.assertEqual(result, None)
mock_response.status_code = 403
result = self.match_metadata.ORACLE_UTIL.cleanup_db()
self.assertEqual(result, None)


if __name__ == '__main__':
unittest.main()

0 comments on commit 825e9a5

Please sign in to comment.