示例#1
0
 def test_post_with_wrong_format(self):
     post = Post.from_text(self.sample_path, SAMPLE_POST_WITH_WRONG_FORMAT, self.config,)
     self.assertIsNone(post)
示例#2
0
 def test_url_with_different_permalink(self):
     self.config.permalink = "blog/:category/:year/:month/:day/:title"
     post = Post.from_text(self.sample_path, SAMPLE_POST, self.config)
     self.assertEqual(post.url, "blog/sample/2010/01/01/a-sample-post/")
示例#3
0
 def setUp(self):
     self.config = FakeConfig()
     Post.config = self.config
     self.sample_path = 'source/posts/sample.md'
     self.post = Post.from_text(self.sample_path, SAMPLE_POST, self.config)