def test_put(azure): data = b'1234567890' * 100 with azure_teardown(azure): with tmpfile() as fn: with open(fn, 'wb') as f: f.write(data) azure.put(fn, a) assert azure.cat(a) == data
def test_get(azure): data = b'1234567890' with azure_teardown(azure): with tmpfile() as fn: with azure.open(a, 'wb') as f: f.write(data) azure.get(a, fn) with open(fn, 'rb') as f: data2 = f.read() assert data2 == data with pytest.raises(IOError): azure.get(b, fn)