コード例 #1
0
 def test_validate_api(self, mock_conn):
     with mock.patch.dict('src.etl.rds.CONFIG', self.config):
         rds = RDS()
         mock_conn.assert_called_once()
         rds.validate_api("api", "https://some.net/api/call")
         self.assertTrue(
             True, "Should not throw an exception on an API in the URL.")
コード例 #2
0
 def test_validate_api_missing(self, mock_conn):
     with mock.patch.dict('src.etl.rds.CONFIG', self.config):
         rds = RDS()
         mock_conn.assert_called_once()
         with self.assertRaises(
                 ValidationException,
                 msg=
                 "Should throw an exception on an API missing in the URL."):
             rds.validate_api("api", "https://some.net/other/call")
コード例 #3
0
 def test_validate_api_missing(self):
     rds = RDS()
     with self.assertRaises(ValidationException, msg="Should throw an exception on an API missing in the URL."):
         rds.validate_api("api", "https://some.net/other/call")
コード例 #4
0
 def test_validate_api(self):
     rds = RDS()
     rds.validate_api("api", "https://some.net/api/call")
     self.assertTrue(True, "Should not throw an exception on an API in the URL.")