'Establish a clean test environment'

def setUp(self):

    super(TestGlanceAPI, self).setUp()
    self.mapper = routes.Mapper()
    self.api = test_utils.FakeAuthMiddleware(router.API(self.mapper))
    self.FIXTURES = [{'id': UUID1, 'name': 'fake    image    #1', 'status': 'active', 'disk_format': 'ami', 'container_format': 'ami', 'is_public': False, 'created_at': timeutils.utcnow(), 'updated_at': timeutils.utcnow(), 'deleted_at': None, 'deleted': False, 'checksum': None, 'size': 13, 'locations': [{'url': ('file:///%s/%s' % (self.test_dir, UUID1)), 'metadata': {}, 'status': 'active'}], 'properties': {'type': 'kernel'}}, {'id': UUID2, 'name': 'fake    image    #2', 'status': 'active', 'disk_format': 'vhd', 'container_format': 'ovf', 'is_public': True, 'created_at': timeutils.utcnow(), 'updated_at': timeutils.utcnow(), 'deleted_at': None, 'deleted': False, 'checksum': 'abc123', 'size': 19, 'locations': [{'url': ('file:///%s/%s' % (self.test_dir, UUID2)), 'metadata': {}, 'status': 'active'}], 'properties': {}}, {'id': UUID3, 'name': 'fake    image    #3', 'status': 'deactivated', 'disk_format': 'ami', 'container_format': 'ami', 'is_public': False, 'created_at': timeutils.utcnow(), 'updated_at': timeutils.utcnow(), 'deleted_at': None, 'deleted': False, 'checksum': '13', 'size': 13, 'locations': [{'url': ('file:///%s/%s' % (self.test_dir, UUID1)), 'metadata': {}, 'status': 'active'}], 'properties': {}}]
    self.context = glance.context.RequestContext(is_admin=True)
    db_api.get_engine()
    self.destroy_fixtures()
    self.addCleanup(self.destroy_fixtures)
    self.create_fixtures()
    self.image_status = []
    self.http_server_pid = None
    self.addCleanup(self._cleanup_server)
    ret = test_utils.start_http_server('foo_image_id', 'foo_image')
    (self.http_server_pid, self.http_port) = ret
