Beispiel #1
0
    def test_resolve_2(self):
        index = indexer.crawl(indexer.build(self.rels2))

        self.assertEqual(indexer.resolve(index), {
            'a': {
                'b': (
                    ('a', 'b'),
                ),
                'c': (
                    ('a', 'c'),
                ),
            },
            'b': {
                'a': (
                    ('b', 'a'),
                ),
                'c': (
                    ('b', 'a'),
                    ('a', 'c'),
                ),
            },
            'c': {
                'a': (
                    ('c', 'a'),
                ),
                'b': (
                    ('c', 'a'),
                    ('a', 'b'),
                )
            },
        })
Beispiel #2
0
    def test_resolve_1(self):
        index = indexer.crawl(indexer.build(self.rels1))

        self.assertEqual(
            indexer.resolve(index),
            {
                "a": {"b": (("a", "b"),), "c": (("a", "b"), ("b", "c"))},
                "b": {"a": (("b", "a"),), "c": (("b", "c"),)},
                "c": {"b": (("c", "b"),), "a": (("c", "b"), ("b", "a"))},
            },
        )
Beispiel #3
0
    def test_resolve_3(self):
        index = indexer.crawl(indexer.build(self.rels3))

        self.assertEqual(indexer.resolve(index), {
            'a': {
                'b': (
                    ('a', 'b', {}),
                ),
            },
            'b': {
                'a': (
                    ('b', 'a', {}),
                ),
            }
        })
Beispiel #4
0
 def test_none(self):
     self.assertEqual(indexer.resolve({}), {})
Beispiel #5
0
    def test_resolve_3(self):
        index = indexer.crawl(indexer.build(self.rels3))

        self.assertEqual(indexer.resolve(index), {"a": {"b": (("a", "b", {}),)}, "b": {"a": (("b", "a", {}),)}})