def test_put_with_lease(self): blob = LocalFileBlob(os.path.join(TEST_FOLDER, 'foobar.blob')) input = (1, 2, 3) blob.delete() blob.put(input, lease_period=0.01) blob.lease(0.01) self.assertEqual(blob.get(), input)
def test_put_without_lease(self): blob = LocalFileBlob(os.path.join(TEST_FOLDER, 'foobar.blob')) input = (1, 2, 3) blob.delete(silent=True) blob.put(input) self.assertEqual(blob.get(), input)
def test_get(self): blob = LocalFileBlob(os.path.join(TEST_FOLDER, 'foobar')) self.assertIsNone(blob.get())
def test_get(self): blob = LocalFileBlob(os.path.join(TEST_FOLDER, 'foobar')) self.assertIsNone(blob.get(silent=True)) self.assertRaises(Exception, lambda: blob.get()) self.assertRaises(Exception, lambda: blob.get(silent=False))