Merge "Clean imports in code"
This commit is contained in:
commit
c06e315e87
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from io import BytesIO
|
import io
|
||||||
from os import environ
|
from os import environ
|
||||||
|
|
||||||
import glance_store
|
import glance_store
|
||||||
@ -75,19 +75,19 @@ class Base(testtools.TestCase):
|
|||||||
class BaseFunctionalTests(Base):
|
class BaseFunctionalTests(Base):
|
||||||
|
|
||||||
def test_add(self):
|
def test_add(self):
|
||||||
image_file = BytesIO(IMAGE_BITS)
|
image_file = io.BytesIO(IMAGE_BITS)
|
||||||
loc, written, _, _ = self.store.add(UUID1, image_file, len(IMAGE_BITS))
|
loc, written, _, _ = self.store.add(UUID1, image_file, len(IMAGE_BITS))
|
||||||
self.assertEqual(len(IMAGE_BITS), written)
|
self.assertEqual(len(IMAGE_BITS), written)
|
||||||
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
image_file = BytesIO(IMAGE_BITS)
|
image_file = io.BytesIO(IMAGE_BITS)
|
||||||
loc, written, _, _ = self.store.add(UUID2, image_file, len(IMAGE_BITS))
|
loc, written, _, _ = self.store.add(UUID2, image_file, len(IMAGE_BITS))
|
||||||
location = glance_store.location.get_location_from_uri(loc)
|
location = glance_store.location.get_location_from_uri(loc)
|
||||||
|
|
||||||
self.store.delete(location)
|
self.store.delete(location)
|
||||||
|
|
||||||
def test_get_size(self):
|
def test_get_size(self):
|
||||||
image_file = BytesIO(IMAGE_BITS)
|
image_file = io.BytesIO(IMAGE_BITS)
|
||||||
loc, written, _, _ = self.store.add(UUID3, image_file, len(IMAGE_BITS))
|
loc, written, _, _ = self.store.add(UUID3, image_file, len(IMAGE_BITS))
|
||||||
location = glance_store.location.get_location_from_uri(loc)
|
location = glance_store.location.get_location_from_uri(loc)
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ class BaseFunctionalTests(Base):
|
|||||||
self.assertEqual(len(IMAGE_BITS), size)
|
self.assertEqual(len(IMAGE_BITS), size)
|
||||||
|
|
||||||
def test_get(self):
|
def test_get(self):
|
||||||
image_file = BytesIO(IMAGE_BITS)
|
image_file = io.BytesIO(IMAGE_BITS)
|
||||||
loc, written, _, _ = self.store.add(UUID3, image_file, len(IMAGE_BITS))
|
loc, written, _, _ = self.store.add(UUID3, image_file, len(IMAGE_BITS))
|
||||||
location = glance_store.location.get_location_from_uri(loc)
|
location = glance_store.location.get_location_from_uri(loc)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user