Beispiel #1
0
    def test_draft_found(self):
        with tmp_folder() as tmp_dir:
            create_project_structure(tmp_dir, 'one_post_drafted')

            cmd = Commands({})
            with capture() as output:
                cmd.drafts()

            regex = re.compile(r".*A draft example.*", re.DOTALL)
            self.assertTrue(regex.match(output[0]))
Beispiel #2
0
    def test_no_drafts_founds(self, l):
        with tmp_folder() as tmp_dir:
            create_project_structure(tmp_dir, 'empty_project')

            cmd = Commands({})
            cmd.drafts()

            self.assertEqual(
                "No drafts found.",
                l.records[0].getMessage()
            )