def test_tag_detailed_found(self): with tmp_folder() as tmp_dir: create_project_structure(tmp_dir, 'one_post') cmd = Commands({'<name>': 'ExampleTag'}) with capture() as output: cmd.tags() regex = re.compile(r".*A post example.*", re.DOTALL) self.assertTrue(regex.match(output[0]))
def test_tag_not_found(self, l): with tmp_folder() as tmp_dir: create_project_structure(tmp_dir, 'one_post') cmd = Commands({'<name>': 'Foo'}) cmd.tags() self.assertEqual( "Tag 'Foo' not found.", l.records[0].getMessage() )
def test_no_tags_founds(self, l): with tmp_folder() as tmp_dir: create_project_structure(tmp_dir, 'empty_project') cmd = Commands({}) cmd.tags() self.assertEqual( "No tags found.", l.records[0].getMessage() )