def test_create(self, ref=None, req_ref=None): deprecations = self.useFixture(client_fixtures.Deprecations()) deprecations.expect_deprecations() ref = ref or self.new_ref() manager_ref = ref.copy() manager_ref.pop('id') # req_ref argument allows you to specify a different # signature for the request when the manager does some # conversion before doing the request (e.g. converting # from datetime object to timestamp string) if req_ref: req_ref = req_ref.copy() else: req_ref = ref.copy() req_ref.pop('id') self.stub_entity('POST', entity=req_ref, status_code=201) returned = self.manager.create(**parameterize(manager_ref)) self.assertIsInstance(returned, self.model) for attr in req_ref: self.assertEqual(getattr(returned, attr), req_ref[attr], 'Expected different %s' % attr) self.assertEntityRequestBodyIs(req_ref) # The entity created here may be used in other test cases return returned
def setUp(self): super(TestCase, self).setUp() self.deprecations = self.useFixture(client_fixtures.Deprecations()) self.logger = self.useFixture(fixtures.FakeLogger(level=logging.DEBUG)) self.requests_mock = self.useFixture(fixture.Fixture())
def setUp(self): super(S3TokenMiddlewareTestUtil, self).setUp() self.useFixture(client_fixtures.Deprecations())
def setUp(self): super(Ec2SignerTest, self).setUp() self.useFixture(client_fixtures.Deprecations()) self.access = '966afbde20b84200ae4e62e09acf46b2' self.secret = '89cdf9e94e2643cab35b8b8ac5a51f83' self.signer = utils.Ec2Signer(self.secret)
def setUp(self): super(MemcacheCryptPositiveTests, self).setUp() self.useFixture(client_fixtures.Deprecations())
def setUp(self): super(TestCheckOsloNamespaceImports, self).setUp() self.useFixture(client_fixtures.Deprecations())