Ejemplo n.º 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))
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 6
0
def mock_Directory__init__(self, jobj):
    canon_jobj = util.map_keys(jobj, self._canon_key)
    self._jobj = canon_jobj
Ejemplo n.º 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))