def test_s3_training_end():
    s3dir = "s3://smdebugcodebuildtest/training_end_test_dir"
    _, bucket, key = is_s3(s3dir)
    f = TSAccessS3(bucket_name=bucket, key_name=key)
    f.close()
    training_has_ended(s3dir)
    assert has_training_ended(s3dir) is True
    delete_s3_prefixes(bucket, key)
Beispiel #2
0
def test_s3_training_end():
    s3key = str(uuid.uuid4())
    s3dir = f"s3://smdebugcodebuildtest/ok_to_delete_{s3key}"
    _, bucket, key = is_s3(s3dir)
    f = TSAccessS3(bucket_name=bucket, key_name=key)
    f.close()
    training_has_ended(s3dir)
    assert has_training_ended(s3dir) is True
    delete_s3_prefixes(bucket, key)
Beispiel #3
0
def test_outdir_non_sagemaker():
    id = str(uuid.uuid4())
    path = "/tmp/tests/" + id
    out_dir = verify_and_get_out_dir(path)
    assert out_dir == path
    os.makedirs(path)
    training_has_ended(path)
    try:
        verify_and_get_out_dir(path)
        # should raise exception as dir present
        assert False
    except RuntimeError as e:
        pass
Beispiel #4
0
def test_local_training_end():
    localdir = "/tmp/training_end_test_dir"
    ensure_dir(localdir, is_file=False)
    training_has_ended(localdir)
    assert has_training_ended(localdir) is True
    shutil.rmtree(localdir)