コード例 #1
0
 def test_it(self):
     from acme.util import map_keys
     self.assertEqual({
         'a': 'b',
         'c': 'd'
     }, map_keys({
         'a': 'b',
         'c': 'd'
     }, lambda key: key))
     self.assertEqual({2: 2, 4: 4}, map_keys({1: 2, 3: 4}, lambda x: x + 1))
コード例 #2
0
 def __init__(self, jobj):
     canon_jobj = util.map_keys(jobj, self._canon_key)
     if not set(canon_jobj).issubset(self._REGISTERED_TYPES):
         # TODO: acme-spec is not clear about this: 'It is a JSON
         # dictionary, whose keys are the "resource" values listed
         # in {{https-requests}}'z
         raise ValueError('Wrong directory fields')
     # TODO: check that everything is an absolute URL; acme-spec is
     # not clear on that
     self._jobj = canon_jobj
コード例 #3
0
ファイル: messages.py プロジェクト: MattDees/letsencrypt
 def __init__(self, jobj):
     canon_jobj = util.map_keys(jobj, self._canon_key)
     if not set(canon_jobj).issubset(self._REGISTERED_TYPES):
         # TODO: acme-spec is not clear about this: 'It is a JSON
         # dictionary, whose keys are the "resource" values listed
         # in {{https-requests}}'z
         raise ValueError('Wrong directory fields')
     # TODO: check that everything is an absolute URL; acme-spec is
     # not clear on that
     self._jobj = canon_jobj
コード例 #4
0
 def __init__(self, jobj):
     canon_jobj = util.map_keys(jobj, self._canon_key)
     # TODO: check that everything is an absolute URL; acme-spec is
     # not clear on that
     self._jobj = canon_jobj
コード例 #5
0
ファイル: messages.py プロジェクト: loenne/homeAutomation
 def __init__(self, jobj):
     canon_jobj = util.map_keys(jobj, self._canon_key)
     # TODO: check that everything is an absolute URL; acme-spec is
     # not clear on that
     self._jobj = canon_jobj
コード例 #6
0
def mock_Directory__init__(self, jobj):
    canon_jobj = util.map_keys(jobj, self._canon_key)
    self._jobj = canon_jobj
コード例 #7
0
ファイル: util_test.py プロジェクト: 1resu/letsencrypt
 def test_it(self):
     from acme.util import map_keys
     self.assertEqual({'a': 'b', 'c': 'd'},
                      map_keys({'a': 'b', 'c': 'd'}, lambda key: key))
     self.assertEqual({2: 2, 4: 4}, map_keys({1: 2, 3: 4}, lambda x: x + 1))