Esempio n. 1
0
 def test_validate_int_float(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 exception on a variable that is not an integer."):
             rds.validate_int("Variable", "100.1", 100, 200)
Esempio n. 2
0
 def test_validate_int(self, mock_conn):
     with mock.patch.dict('src.etl.rds.CONFIG', self.config):
         rds = RDS()
         rds.validate_int("Variable", "100", 100, 200)
         mock_conn.assert_called_once()
         self.assertTrue(
             True,
             "Should not throw exception on a variable that is an integer.")
Esempio n. 3
0
 def test_validate_int_outside_range(self, mock_conn):
     rds = RDS()
     mock_conn.assert_called_once()
     with self.assertRaises(
             ValidationException,
             msg=
             "Should throw exception on a variable that is not an integer in range."
     ):
         rds.validate_int("Variable", "99", 100, 200)
Esempio n. 4
0
 def test_validate_int_float(self):
     rds = RDS()
     with self.assertRaises(ValidationException, msg="Should throw exception on a variable that is not an integer."):
         rds.validate_int("Variable", "100.1", 100, 200)
Esempio n. 5
0
 def test_validate_int(self):
     rds = RDS()
     rds.validate_int("Variable", "100", 100, 200)
     self.assertTrue(True, "Should not throw exception on a variable that is an integer.")