def test_add_available_with_package(self): """verify that within a supporting package, add is available""" paster(" ".join(self.options)) # I would expect this to work too, but it does not, why?: # command_output = read_sh(self.cmd + " " + " ".join(self.options)) # expected = 'Your new package supports local commands' # self.assertTrue(expected in command_output) os.chdir(os.path.sep.join(['plone.example', 'src'])) cmd_pattern = r"^\s*add" help_text = read_sh(self.cmd + ' help') matches = re.search(cmd_pattern, help_text, re.I|re.M) self.assertTrue(matches is not None, 'add command should be present')
def test_add_not_generally_available(self): cmd_pattern = r"^\s*add" help_text = read_sh(self.cmd + ' help') matches = re.search(cmd_pattern, help_text, re.I|re.M) self.assertEquals(matches, None, "add command should not be present")