Beispiel #1
0
def test_move(teardown):
    local_file = get_local_filename(BLOB_FILE)
    temp_file = get_temp_local_filename(BLOB_FILE)
    temp_file2 = get_temp_local_filename(BLOB_FILE)
    teardown.delete(temp_file)
    teardown.delete(temp_file2)
    storage.copy(local_file, temp_file)
    storage.move(temp_file, temp_file2)
    assert_that(storage.get(temp_file2)).is_equal_to(BLOB_DATA)
    assert_that(storage.exists(temp_file)).is_false()
Beispiel #2
0
def test_local_does_not_exist():
    local_file = get_local_filename('some_file_that_does_not_exist.txt')
    assert_that(storage.exists(local_file)).is_false()
Beispiel #3
0
def test_remote_does_not_exist():
    remote_file = get_gcs_filename('some_file_that_does_not_exist.txt')
    assert_that(storage.exists(remote_file)).is_false()
Beispiel #4
0
def test_remote_exist():
    remote_file = get_gcs_filename(JSON_FILE)
    assert_that(storage.exists(remote_file)).is_true()
Beispiel #5
0
def test_local_exist():
    local_file = get_local_filename(JSON_FILE)
    assert_that(storage.exists(local_file)).is_true()
Beispiel #6
0
 def teardown(self):
     print('Cleaning up', self.files_to_delete)
     for f in self.files_to_delete:
         if storage.exists(f):
             storage.delete(f)