def test_put_with_error_returned(self): self.setup_connection( MAASFileStorage, FakeFileStorageWithErrorOnAddingFile) storage = MAASFileStorage(CONFIG) fileObj = BytesIO("some data") d = storage.put("foo", fileObj) return self.assertFailure(d, ProviderError)
def test_put_succeeds(self): self.setup_connection(MAASFileStorage, FakeFileStorage) storage = MAASFileStorage(CONFIG) fileObj = BytesIO("some data") d = storage.put("foo", fileObj) d.addCallback(self.assertTrue) d.addErrback(self.fail) return d