def test_replace_signposts(self):
        ppl = PackagePathLoader()
        ppl._replace_signpost = mock.Mock()
        paths = [["site-theme", None], ["ep0", "/ep0"], ["ep1", "/ep1"], ["ep2", "/ep2"], ["allura", "/"]]
        rules = {"allura": "ep2", "site-theme": "ep1", "foo": "ep1", "ep0": "bar"}

        ppl._replace_signposts(paths, rules)

        assert_equal(paths, [["site-theme", "/ep1"], ["ep0", "/ep0"], ["allura", "/ep2"]])
    def test_replace_signposts(self):
        ppl = PackagePathLoader()
        ppl._replace_signpost = mock.Mock()
        paths = [
                ['site-theme', None],
            ['ep0', '/ep0'],
            ['ep1', '/ep1'],
            ['ep2', '/ep2'],
            ['allura', '/'],
        ]
        rules = {
            'allura': 'ep2',
            'site-theme': 'ep1',
            'foo': 'ep1',
            'ep0': 'bar',
        }

        ppl._replace_signposts(paths, rules)

        assert_equal(paths, [
            ['site-theme', '/ep1'],
            ['ep0', '/ep0'],
            ['allura', '/ep2'],
        ])
    def test_replace_signposts(self):
        ppl = PackagePathLoader()
        ppl._replace_signpost = mock.Mock()
        paths = [
            ['site-theme', None],
            ['ep0', '/ep0'],
            ['ep1', '/ep1'],
            ['ep2', '/ep2'],
            ['allura', '/'],
        ]
        rules = {
            'allura': 'ep2',
            'site-theme': 'ep1',
            'foo': 'ep1',
            'ep0': 'bar',
        }

        ppl._replace_signposts(paths, rules)

        assert_equal(paths, [
            ['site-theme', '/ep1'],
            ['ep0', '/ep0'],
            ['allura', '/ep2'],
        ])
Esempio n. 4
0
    def test_replace_signposts(self):
        ppl = PackagePathLoader()
        ppl._replace_signpost = mock.Mock()
        paths = [
            ['site-theme', None],
            ['ep0', '/ep0'],
            ['ep1', '/ep1'],
            ['ep2', '/ep2'],
            ['allura', '/'],
        ]
        rules = OrderedDict([
            ('allura', 'ep2'),
            ('site-theme', 'ep1'),
            ('foo', 'ep1'),
            ('ep0', 'bar'),
        ])

        ppl._replace_signposts(paths, rules)

        assert_equal(paths, [
            ['site-theme', '/ep1'],
            ['ep0', '/ep0'],
            ['allura', '/ep2'],
        ])