Esempio n. 1
0
def test_stage_oldest_tsv_file_removes_staged_file_from_output_dir(tmpdir):
    tmp_directory = str(tmpdir)
    identifier = TEST_ID
    test_tsv = 'test.tsv'
    path = tmpdir.join(test_tsv)
    path.write('')
    paths.stage_oldest_tsv_file(tmp_directory, identifier, 0)

    assert path.check(file=0)
Esempio n. 2
0
def test_stage_oldest_tsv_file_ignores_non_tsv(tmpdir):
    tmp_directory = str(tmpdir)
    staging_subdirectory = paths.STAGING_SUBDIRECTORY
    identifier = TEST_ID
    test = 't'
    path = tmpdir.join(test)
    path.write('')
    paths.stage_oldest_tsv_file(tmp_directory, identifier, 0)
    staged_path = tmpdir.join(staging_subdirectory, identifier, test)
    assert staged_path.check(file=0)
    assert path.check(file=1)
Esempio n. 3
0
def test_stage_oldest_tsv_file_stages_older_file(tmpdir):
    tmp_directory = str(tmpdir)
    staging_subdirectory = paths.STAGING_SUBDIRECTORY
    identifier = TEST_ID
    test_one_tsv = 'test1.tsv'
    test_two_tsv = 'test2.tsv'
    path_one = tmpdir.join(test_one_tsv)
    path_one.write('')
    time.sleep(0.01)
    path_two = tmpdir.join(test_two_tsv)
    path_two.write('')
    paths.stage_oldest_tsv_file(tmp_directory, identifier, 0)
    staged_path = tmpdir.join(staging_subdirectory, identifier, test_one_tsv)
    assert staged_path.check(file=1)
Esempio n. 4
0
def test_stage_oldest_tsv_file_finds_tsv_file(tmpdir):
    tmp_directory = str(tmpdir)
    identifier = TEST_ID
    test_tsv = 'test.tsv'
    path = tmpdir.join(test_tsv)
    path.write('')
    tsv_found = paths.stage_oldest_tsv_file(tmp_directory, identifier, 0)

    assert tsv_found