def test_munge_dict_text_value(self):
     api = API()
     row = {"key": "value"}
     new_row = api._munge_dict(row)
     self.assertEqual(new_row["key"], "value")
 def test_munge_dict_empty_value(self):
     api = API()
     row = {"key": ""}
     new_row = api._munge_dict(row)
     self.assertIsNone(new_row["key"])
 def test_munge_dict_int_value(self):
     api = API()
     row = {"key": "666"}
     new_row = api._munge_dict(row)
     self.assertEqual(new_row["key"], 666)
 def test_munge_dict_float_value(self):
     api = API()
     row = {"key": "66.6"}
     new_row = api._munge_dict(row)
     self.assertAlmostEqual(new_row["key"], 66.6)
 def test_custom_data_root(self):
     api = API("/home/data/")
     self.assertEqual(api.data_root, "/home/data/")
 def test_data_root_in_str_and_repr(self):
     api = API()
     self.assertIn(api.data_root, str(api))
     self.assertIn(api.data_root, repr(api))
 def test_default_data_root(self):
     api = API()
     self.assertEqual(api.data_root, KPLR_ROOT)
Ejemplo n.º 8
0
 def test_munge_dict_empty_value(self):
     api = API()
     row = {"key": ""}
     new_row = api._munge_dict(row)
     self.assertIsNone(new_row["key"])
Ejemplo n.º 9
0
 def test_munge_dict_text_value(self):
     api = API()
     row = {"key": "value"}
     new_row = api._munge_dict(row)
     self.assertEqual(new_row["key"], "value")
Ejemplo n.º 10
0
 def test_munge_dict_float_value(self):
     api = API()
     row = {"key": "66.6"}
     new_row = api._munge_dict(row)
     self.assertAlmostEqual(new_row["key"], 66.6)
Ejemplo n.º 11
0
 def test_munge_dict_int_value(self):
     api = API()
     row = {"key": "666"}
     new_row = api._munge_dict(row)
     self.assertEqual(new_row["key"], 666)