コード例 #1
0
ファイル: test_sql_copy.py プロジェクト: CartoDB/carto-python
def test_copyto_file_object(copy_client, copyto_sample_query,
                            copyto_expected_result):
    in_memory_target_fileobj = InMemIO()

    copy_client.copyto_file_object(copyto_sample_query,
                                   in_memory_target_fileobj)
    assert in_memory_target_fileobj.getvalue() == copyto_expected_result

    in_memory_target_fileobj.close()
コード例 #2
0
def test_copyto_file_object(copy_client, copyto_sample_query,
                            copyto_expected_result):
    in_memory_target_fileobj = InMemIO()

    copy_client.copyto_file_object(copyto_sample_query,
                                   in_memory_target_fileobj)
    assert in_memory_target_fileobj.getvalue() == copyto_expected_result

    in_memory_target_fileobj.close()
コード例 #3
0
 def _get_map(self):
     file = BytesIO(cache(self, self.map_path))
     remap = np.load(file)
     file.close()
     return remap