def test_read_not_empty(self, mock_container_list): mock_container_list.return_value = [{"name": "name"}] config = { "container": "container", "file_filter": ".*", "file_type": None } data = read_from_objectstore(connection=None, config=config) self.assertEqual(data, [{"name": "name"}])
def test_read(self, mock_container_list): config = { "container": "container", "file_filter": ".*", "file_type": None } data = read_from_objectstore(connection=None, config=config) self.assertEqual(data, []) mock_container_list.assert_called()
def test_read_from_csv(self, mock_container_list, mock_object, mock_read_csv): mock_read_csv.return_value = [] mock_container_list.return_value = [{"name": "name"}] config = { "container": "container", "file_filter": ".*", "file_type": "CSV" } data = read_from_objectstore(connection=None, config=config) self.assertEqual(data, []) mock_read_csv.assert_called()