コード例 #1
0
 def test_iter_interfaces(self):
     mapping = [('a', 1), ('b', 2), ('a', 2), ('d', 3), ('a', 1), ('a', 3),
                ('d', 4), ('c', 3)]
     md = self.storage_class(mapping)
     assert list(zip(md.keys(), md.listvalues())) == list(md.lists())
     assert list(zip(md, iterlistvalues(md))) == list(iterlists(md))
     assert list(zip(iterkeys(md), iterlistvalues(md))) == \
         list(iterlists(md))
コード例 #2
0
 def test_iter_interfaces(self):
     mapping = [('a', 1), ('b', 2), ('a', 2), ('d', 3),
                ('a', 1), ('a', 3), ('d', 4), ('c', 3)]
     md = self.storage_class(mapping)
     assert list(zip(md.keys(), md.listvalues())) == list(md.lists())
     assert list(zip(md, iterlistvalues(md))) == list(iterlists(md))
     assert list(zip(iterkeys(md), iterlistvalues(md))) == \
         list(iterlists(md))
コード例 #3
0
 def test_iter_interfaces(self):
     mapping = [
         ("a", 1),
         ("b", 2),
         ("a", 2),
         ("d", 3),
         ("a", 1),
         ("a", 3),
         ("d", 4),
         ("c", 3),
     ]
     md = self.storage_class(mapping)
     assert list(zip(md.keys(), md.listvalues())) == list(md.lists())
     assert list(zip(md, iterlistvalues(md))) == list(iterlists(md))
     assert list(zip(iterkeys(md), iterlistvalues(md))) == list(iterlists(md))
コード例 #4
0
 def test_iter_interfaces(self):
     mapping = [
         ("a", 1),
         ("b", 2),
         ("a", 2),
         ("d", 3),
         ("a", 1),
         ("a", 3),
         ("d", 4),
         ("c", 3),
     ]
     md = self.storage_class(mapping)
     assert list(zip(md.keys(), md.listvalues())) == list(md.lists())
     assert list(zip(md, iterlistvalues(md))) == list(iterlists(md))
     assert list(zip(iterkeys(md), iterlistvalues(md))) == list(iterlists(md))
コード例 #5
0
ファイル: datastructures.py プロジェクト: fdion/webfive-pyjs
    def test_iterables(self):
        a = datastructures.MultiDict((("key_a", "value_a"),))
        b = datastructures.MultiDict((("key_b", "value_b"),))
        ab = datastructures.CombinedMultiDict((a,b))

        self.assert_equal(sorted(ab.lists()), [('key_a', ['value_a']), ('key_b', ['value_b'])])
        self.assert_equal(sorted(ab.listvalues()), [['value_a'], ['value_b']])
        self.assert_equal(sorted(ab.keys()), ["key_a", "key_b"])

        self.assert_equal(sorted(iterlists(ab)), [('key_a', ['value_a']), ('key_b', ['value_b'])])
        self.assert_equal(sorted(iterlistvalues(ab)), [['value_a'], ['value_b']])
        self.assert_equal(sorted(iterkeys(ab)), ["key_a", "key_b"])
コード例 #6
0
ファイル: test_datastructures.py プロジェクト: galicea/bryk
    def test_iterables(self):
        a = datastructures.MultiDict((("key_a", "value_a"),))
        b = datastructures.MultiDict((("key_b", "value_b"),))
        ab = datastructures.CombinedMultiDict((a, b))

        assert sorted(ab.lists()) == [('key_a', ['value_a']), ('key_b', ['value_b'])]
        assert sorted(ab.listvalues()) == [['value_a'], ['value_b']]
        assert sorted(ab.keys()) == ["key_a", "key_b"]

        assert sorted(iterlists(ab)) == [('key_a', ['value_a']), ('key_b', ['value_b'])]
        assert sorted(iterlistvalues(ab)) == [['value_a'], ['value_b']]
        assert sorted(iterkeys(ab)) == ["key_a", "key_b"]
コード例 #7
0
    def test_iterables(self):
        a = datastructures.MultiDict((("key_a", "value_a"),))
        b = datastructures.MultiDict((("key_b", "value_b"),))
        ab = datastructures.CombinedMultiDict((a, b))

        assert sorted(ab.lists()) == [("key_a", ["value_a"]), ("key_b", ["value_b"])]
        assert sorted(ab.listvalues()) == [["value_a"], ["value_b"]]
        assert sorted(ab.keys()) == ["key_a", "key_b"]

        assert sorted(iterlists(ab)) == [("key_a", ["value_a"]), ("key_b", ["value_b"])]
        assert sorted(iterlistvalues(ab)) == [["value_a"], ["value_b"]]
        assert sorted(iterkeys(ab)) == ["key_a", "key_b"]