예제 #1
0
 def test_infer(self):
     input_integer = '233692469'
     output_i = infer(input_integer)
     self.assertEqual(output_i, "integer")
     self.assertIsNot(output_i, "string")
     self.assertIsNot(output_i, "number")
     self.assertIsNot(output_i, None)
     input_string = 'test'
     output_s = infer(input_string)
     self.assertEqual(output_s, "string")
     self.assertIsNot(output_s, "integer")
     self.assertIsNot(output_s, "number")
     self.assertIsNot(output_s, None)
     input_empty = ''
     output_e = infer(input_empty)
     self.assertEqual(output_e, None)
     self.assertIsNot(output_e, "integer")
     self.assertIsNot(output_e, "number")
     self.assertIsNot(output_e, "string")
예제 #2
0
 def test_infer_datum_equals_to_none(self):
     res = conversion.infer(None, None, [])
     self.assertEqual(res, None)
예제 #3
0
 def test_infer_datum_equals_to_list_datetime(self):
     res = conversion.infer("created_at", ["20-05-2021"], ["created_at"])
     self.assertEqual(res, "list.date-time")
예제 #4
0
 def test_infer_datum_equals_to_list_string(self):
     res = conversion.infer(None, ["test", "test1"], [])
     self.assertEqual(res, "list.string")
예제 #5
0
 def test_infer_datum_equals_to_list_number(self):
     res = conversion.infer(None, [5.9, 6.9], [])
     self.assertEqual(res, "list.number")
예제 #6
0
 def test_infer_datum_equals_to_list_list(self):
     res = conversion.infer(None, [[5, 6], 6], [])
     self.assertEqual(res, "list.string")
예제 #7
0
 def test_infer_datum_equals_to_list_integer(self):
     res = conversion.infer(None, [5, 6], [])
     self.assertEqual(res, "list.integer")
예제 #8
0
 def test_infer_datum_equals_to_dict(self):
     res = conversion.infer(None, {'test': 'test'}, [])
     self.assertEqual(res, "dict")
예제 #9
0
 def test_infer_datum_equals_to_string(self):
     res = conversion.infer(None, "test", [])
     self.assertEqual(res, "string")
예제 #10
0
 def test_infer_datum_equals_to_number(self):
     res = conversion.infer(None, 4.5, [])
     self.assertEqual(res, "number")
예제 #11
0
 def test_infer_datum_equals_to_integer(self):
     res = conversion.infer(None, 5, [])
     self.assertEqual(res, "integer")