Exemplo n.º 1
0
 def testWorks(self):
     """Test that it works as described."""
     d = {'a': 1, 'b': 2}
     d2 = utils.swap_keys_and_values(d)
     self.assertEqual(d2, {1: 'a', 2: 'b'})
Exemplo n.º 2
0
 def __init__(self, dependencies):
     self.node_to_outgoing_map = self._create_node_to_outgoing(dependencies)
     self.node_to_id_map = self._create_node_to_id(self.node_to_outgoing_map.keys())
     self.id_to_node_map = utils.swap_keys_and_values(self.node_to_id_map)
Exemplo n.º 3
0
 def testWorks(self):
     """Test that it works as described."""
     d = {'a':1, 'b':2}
     d2 = utils.swap_keys_and_values(d)
     self.assertEqual(d2, {1:'a', 2:'b'})
Exemplo n.º 4
0
 def __init__(self, dependencies):
     self.node_to_outgoing_map = self._create_node_to_outgoing(dependencies)
     self.node_to_id_map = self._create_node_to_id(
         self.node_to_outgoing_map.keys())
     self.id_to_node_map = utils.swap_keys_and_values(self.node_to_id_map)