def test_remove_http(): ops = PerceptOps(kConfig) with pytest.raises(NotImplementedError): ops.remove( 'http://' + os.path.join( constants.kExampleBucket + '.' + constants.kS3HostName, kKeys[1]), None)
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)
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
def test_remove_http(): ops = PerceptOps(kConfig) with pytest.raises(NotImplementedError): ops.remove('http://' + os.path.join(constants.kExampleBucket + '.' + constants.kS3HostName, kKeys[1]), None)