def test_get_namespaces_from_egginfo(self): """verify that the current namespace package(s) can be determined""" paster(" ".join(self.options)) os.chdir(os.path.sep.join(['plone.example', 'src'])) # this should return a list of namespace packages namespaces = self.local_cmd.get_namespaces_from_egginfo() self.assertTrue('plone' in namespaces)
def test_dest_dir(self): """verify the coorect destination directory for template generation""" paster(" ".join(self.options)) os.chdir(os.path.sep.join(['plone.example', 'src'])) dest_dir = self.local_cmd.dest_dir() expected = os.path.sep.join(['plone.example', 'src', 'plone', 'example']) self.assertTrue(dest_dir.endswith(expected))
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')