def test_subtable(self): t = RoutingTable() t['a', 'b'] = 1 t['b', 'c'] = 1 t['c', 'd'] = 1 t['d', 'a'] = 1 s = t.subtable(['a', 'b', 'c']) assert set(s.ids) == set(['a', 'b', 'c']) assert set(s.connections) == set([('a', 'b'), ('b', 'c')])