Beispiel #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))
Beispiel #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
Beispiel #3
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
Beispiel #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
Beispiel #5
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
Beispiel #6
0
def mock_Directory__init__(self, jobj):
    canon_jobj = util.map_keys(jobj, self._canon_key)
    self._jobj = canon_jobj
Beispiel #7
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))