예제 #1
0
    def test_lookup_duplicate_page_slug_raises_argumenttypeerror(self):
        duplicate_slug = 'two-pages-with-this-slug'

        page = create_simple_page(self.root_page, duplicate_slug)
        create_simple_page(page, duplicate_slug)

        with self.assertRaises(argparse.ArgumentTypeError):
            lookup_page_slug(duplicate_slug)
예제 #2
0
 def test_lookup_nonexistent_page_slug_raises_argumenttypeerror(self):
     with self.assertRaises(argparse.ArgumentTypeError):
         lookup_page_slug('this-page-does-not-exist')
예제 #3
0
 def test_lookup_valid_page_slug(self):
     self.assertEqual(lookup_page_slug(self.root_page.slug), self.root_page)