def test_copy_with_existing_source_blob_is_successful(self) -> None: dev_mode_storage_services.commit('bucket', '/file/path.png', b'data', 'image/png') dev_mode_storage_services.copy('bucket', '/file/path.png', '/copy/path.png') self.assertTrue( dev_mode_storage_services.isfile('bucket', '/copy/path.png')) self.assertEqual( dev_mode_storage_services.get('bucket', '/file/path.png'), dev_mode_storage_services.get('bucket', '/copy/path.png'))
def test_copy_with_non_existing_source_blob_fails(self) -> None: with self.assertRaisesRegexp( # type: ignore[no-untyped-call] Exception, 'Source asset does not exist'): dev_mode_storage_services.copy('bucket', '/file/path.png', '/copy/path.png')