def test_filter_out(self): for key, src, exp_in, exp_out in filter_examples: r = utils.filter_out(src, key) self.assert_dicts_are_equal(r, exp_out) for k in exp_in: self.assertFalse(k in r) r = utils.filter_out(src, key, True) if key in src: expected = dict(src) expected.pop(key) self.assert_dicts_are_equal(r, expected) else: self.assert_dicts_are_equal(r, src)
def del_account_meta(self, metakey): """ :param metakey: (str) metadatum key """ headers = self.get_account_info() self.headers = filter_out(headers, 'X-Account-Meta-' + metakey, exactMatch=True) if len(self.headers) == len(headers): raise ClientError('X-Account-Meta-%s not found' % metakey, 404) path = path4url(self.account) self.post(path, success=202)
def del_account_meta(self, metakey): """ :param metakey: (str) metadatum key """ headers = self.get_account_info() self.headers = filter_out( headers, 'X-Account-Meta-' + metakey, exactMatch=True) if len(self.headers) == len(headers): raise ClientError('X-Account-Meta-%s not found' % metakey, 404) path = path4url(self.account) self.post(path, success=202)