コード例 #1
0
def test_save_blob_to_local(teardown):
    local_file = get_temp_local_filename(BLOB_FILE)
    teardown.delete(local_file)
    storage.save(BLOB_DATA, local_file)
    assert_that(storage.get(local_file)).is_equal_to(BLOB_DATA)
コード例 #2
0
def test_save_pandas_to_csv(teardown):
    local_file = get_temp_local_filename(CSV_FILE)
    teardown.delete(local_file)
    storage.save(pd.DataFrame(CSV_DATA), local_file)
    assert_that(storage.get(local_file)).is_equal_to(CSV_DATA)
コード例 #3
0
def test_save_blob_to_gcs(teardown):
    remote_file = get_temp_gcs_filename(BLOB_FILE)
    teardown.delete(remote_file)
    storage.save(BLOB_DATA, remote_file)
    assert_that(storage.get(remote_file)).is_equal_to(BLOB_DATA)
コード例 #4
0
def test_save_raw_csv_to_local(teardown):
    local_file = get_temp_local_filename(CSV_FILE)
    teardown.delete(local_file)
    storage.save(CSV_DATA_RAW, local_file, asBlob=True)
    assert_that(storage.get(local_file)).is_equal_to(CSV_DATA)