def test_map_metadata_data_type_python_data_type(self): '''Does _map_metadata_data_type() return a dictionary key corresponding to the Python data type of a column? ''' test_col = [{'id': 'test', 'type': 'type_str'}] self.assertIsNotNone( client._map_metadata_data_type(test_col)[0].get('python_type'))
def test_map_metadata_data_type_correct_python_data_type(self): '''Does _map_metadata_data_type() return the correct Python data type for the type string returned? ''' test_col = [{'id': 'test', 'type': 'type_numeric'}] self.assertEquals( client._map_metadata_data_type( test_col)[0]['python_type'], decimal.Decimal)
def test_map_metadata_data_type_correct_python_data_type(self): '''Does _map_metadata_data_type() return the correct Python data type for the type string returned? ''' test_col = [{'id': 'test', 'type': 'type_numeric'}] self.assertEquals( client._map_metadata_data_type(test_col)[0]['python_type'], decimal.Decimal)
def test_map_metadata_data_type_unknown_python_data_type(self): '''Does _map_metadata_data_type() return str for an unknown data type? ''' test_col = [{'id': 'test', 'type': 'type_unknown'}] self.assertEquals( client._map_metadata_data_type(test_col)[0]['python_type'], str)