Skip to content

Commit

Permalink
Delete redundant unit tests - tests are replicated in test_file_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Dec 8, 2023
1 parent 428c497 commit ed7a4ce
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions nmdc_automation/jgi_file_staging/tests/test_jgi_file_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,44 +68,8 @@ def tearDown(self) -> None:
mdb.samples.drop()
mdb.globus.drop()

@patch("jgi_file_staging.requests.get")
def test_get_access_token(self, mock_get):
mock_get.return_value.status_code = 200
mock_get.return_value.text = "ed42ef1556708305eaf8"
ACCESS_TOKEN = get_access_token()
self.assertEqual(ACCESS_TOKEN, "ed42ef1556708305eaf8")

@patch("jgi_file_staging.requests.get")
def test_check_access_token(self, mock_get):
mock_get.return_value.status_code = 200
ACCESS_TOKEN = "ed42ef1556708305eaf8"
ACCESS_TOKEN = check_access_token(ACCESS_TOKEN)
self.assertEqual(ACCESS_TOKEN, "ed42ef1556708305eaf8")

@patch("jgi_file_staging.requests.get")
def test_check_access_token_invalid(self, mock_get):
response_mock1 = Mock()
response_mock1.status_code = 400
response_mock1.text = "ed42ef1556"
response_mock2 = Mock()
response_mock2.status_code = 200
response_mock2.text = "ed42ef155670"
mock_get.side_effect = [response_mock1, response_mock2]

ACCESS_TOKEN = "ed42ef1556708305eaf8"
ACCESS_TOKEN = check_access_token(ACCESS_TOKEN)
self.assertEqual(ACCESS_TOKEN, "ed42ef155670")

@patch("jgi_file_staging.requests.get")
def test_get_sequence_id(self, mock_get):
mock_get.return_value.status_code = 200
mock_get.return_value.json.return_value = [{"itsSpid": 1323348}]
sequence_id = get_sequence_id("Ga0499978", "ed42ef155670")
self.assertEqual(sequence_id, 1323348)

mock_get.return_value.status_code = 403
sequence_id = get_sequence_id("Ga0499978", "ed42ef155670")
self.assertEqual(sequence_id, None)

@patch("jgi_file_staging.requests.get")
def test_get_analysis_projects_from_proposal_id(self, mock_get):
Expand Down

0 comments on commit ed7a4ce

Please sign in to comment.