Exemplo n.º 1
0
    def test_sort(self):
        posts = [os.path.join('posts', post) for post in os.listdir('posts')]

        new_tags = sort_tags(self._site, posts)
        new_parsed_tags = self._parse_new_tags(posts[0])

        self.assertEquals(sorted(DEMO_TAGS), new_parsed_tags)
        self.assertEquals(sorted(DEMO_TAGS), new_tags)
Exemplo n.º 2
0
    def test_sort(self):
        posts = [os.path.join('posts', post) for post in os.listdir('posts')]

        new_tags = sort_tags(self._site, posts)
        new_parsed_tags = self._parse_new_tags(posts[0])

        self.assertEquals(sorted(DEMO_TAGS), new_parsed_tags)
        self.assertEquals(sorted(DEMO_TAGS), new_tags[0])
Exemplo n.º 3
0
    def test_sort_dry_run(self):
        posts = [os.path.join('posts', post) for post in os.listdir('posts')]

        old_parsed_tags = self._parse_new_tags(posts[0])
        new_tags = sort_tags(self._site, posts, dry_run=True)
        new_parsed_tags = self._parse_new_tags(posts[0])

        self.assertEquals(old_parsed_tags, new_parsed_tags)
        self.assertEquals(sorted(DEMO_TAGS), new_tags)
Exemplo n.º 4
0
    def test_sort_dry_run(self):
        posts = [os.path.join('posts', post) for post in os.listdir('posts')]

        old_parsed_tags = self._parse_new_tags(posts[0])
        new_tags = sort_tags(self._site, posts, dry_run=True)
        new_parsed_tags = self._parse_new_tags(posts[0])

        self.assertEquals(old_parsed_tags, new_parsed_tags)
        self.assertEquals(sorted(DEMO_TAGS), new_tags[0])