Exemplo n.º 1
0
def test_remove_http():
    ops = PerceptOps(kConfig)
    with pytest.raises(NotImplementedError):
        ops.remove(
            'http://' + os.path.join(
                constants.kExampleBucket + '.' + constants.kS3HostName,
                kKeys[1]), None)
Exemplo n.º 2
0
def test_remove_local():
    shutil.copy(constants.kExampleImageFile,
                constants.kExampleTemporaryImageFile)
    assert os.path.exists(constants.kExampleTemporaryImageFile)
    ops = PerceptOps(kConfig)
    ops.remove(constants.kExampleTemporaryImageFile)
    assert not os.path.exists(constants.kExampleTemporaryImageFile)
Exemplo n.º 3
0
def test_remove_s3():
    ops = PerceptOps(kConfig)
    assert ops.read('s3://' + os.path.join(constants.kExampleBucket, kKeys[0]),
                    None) is not None
    ops.remove('s3://' + os.path.join(constants.kExampleBucket, kKeys[0]),
               None)
    assert ops.read('s3://' + os.path.join(constants.kExampleBucket, kKeys[0]),
                    None) is None
Exemplo n.º 4
0
def test_remove_http():
	ops = PerceptOps(kConfig)
	with pytest.raises(NotImplementedError):
		ops.remove('http://' + os.path.join(constants.kExampleBucket + '.' + constants.kS3HostName, kKeys[1]), None)
Exemplo n.º 5
0
def test_remove_s3():
	ops = PerceptOps(kConfig)
	assert ops.read('s3://' + os.path.join(constants.kExampleBucket, kKeys[0]), None) is not None
	ops.remove('s3://' + os.path.join(constants.kExampleBucket, kKeys[0]), None)
	assert ops.read('s3://' + os.path.join(constants.kExampleBucket, kKeys[0]), None) is None
Exemplo n.º 6
0
def test_remove_local():
	shutil.copy(constants.kExampleImageFile, constants.kExampleTemporaryImageFile)
	assert os.path.exists(constants.kExampleTemporaryImageFile)
	ops = PerceptOps(kConfig)
	ops.remove(constants.kExampleTemporaryImageFile)
	assert not os.path.exists(constants.kExampleTemporaryImageFile)