示例#1
0
文件: test.py 项目: Erethon/kamaki
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)