def test_find_hook(self): """Finds the specified hook.""" with utils.work_in(self.repo_path): expected_pre = os.path.abspath("hooks/pre_gen_project.py") actual_hook_path = hooks.find_hook("pre_gen_project") assert expected_pre == actual_hook_path expected_post = os.path.abspath("hooks/{}".format(self.post_hook)) actual_hook_path = hooks.find_hook("post_gen_project") assert expected_post == actual_hook_path
def test_find_hook(self): """Finds the specified hook.""" with cookiecutter.utils.context_manager.work_in(self.repo_path): expected_pre = os.path.abspath('hooks/pre_gen_project.py') actual_hook_path = hooks.find_hook('pre_gen_project') assert expected_pre == actual_hook_path[0] expected_post = os.path.abspath('hooks/{}'.format(self.post_hook)) actual_hook_path = hooks.find_hook('post_gen_project') assert expected_post == actual_hook_path[0]
def test_find_hook(self): """Finds the specified hook.""" with utils.work_in(self.repo_path): expected_pre = os.path.abspath('hooks/pre_gen_project.py') actual_hook_path = hooks.find_hook('pre_gen_project') assert expected_pre == actual_hook_path expected_post = os.path.abspath('hooks/{}'.format(self.post_hook)) actual_hook_path = hooks.find_hook('post_gen_project') assert expected_post == actual_hook_path
def test_no_hooks(self): """find_hooks should return None if the hook could not be found.""" with utils.work_in("tests/fake-repo"): assert None is hooks.find_hook("pre_gen_project")
def test_ignore_hook_backup_files(monkeypatch, dir_with_hooks): # Change the current working directory that contains `hooks/` monkeypatch.chdir(dir_with_hooks) assert hooks.find_hook("pre_gen_project") is None assert hooks.find_hook("post_gen_project") is None
def test_hook_not_found(self): """`find_hooks` should return None if the hook could not be found.""" with utils.work_in(self.repo_path): assert hooks.find_hook('unknown_hook') is None
def test_unknown_hooks_dir(self): """`find_hooks` should return None if hook directory not found.""" with utils.work_in(self.repo_path): assert hooks.find_hook('pre_gen_project', hooks_dir='hooks_dir') is None
def test_no_hooks(self): """`find_hooks` should return None if the hook could not be found.""" with utils.work_in('tests/fake-repo'): assert None is hooks.find_hook('pre_gen_project')
def test_no_hooks(self): """`find_hooks` should return None if the hook could not be found.""" with cookiecutter.utils.context_manager.work_in( 'tests/fixtures/fake-repo'): assert None is hooks.find_hook('pre_gen_project')
def test_hook_not_found(self): """`find_hooks` should return None if the hook could not be found.""" with cookiecutter.utils.context_manager.work_in(self.repo_path): assert hooks.find_hook('unknown_hook') is None
def test_hook_not_found(self): with utils.work_in(self.repo_path): assert hooks.find_hook('unknown_hook') is None
def test_unknown_hooks_dir(self): with utils.work_in(self.repo_path): assert hooks.find_hook( 'pre_gen_project', hooks_dir='hooks_dir' ) is None
def test_no_hooks(self): """find_hooks should return None if the hook could not be found.""" with utils.work_in('tests/fake-repo'): assert None is hooks.find_hook('pre_gen_project')
def test_unknown_hooks_dir(self): with utils.work_in(self.repo_path): assert hooks.find_hook("pre_gen_project", hooks_dir="hooks_dir") is None
def test_ignore_hook_backup_files(monkeypatch, dir_with_hooks): """Test `find_hook` correctly use `valid_hook` verification function.""" # Change the current working directory that contains `hooks/` monkeypatch.chdir(dir_with_hooks) assert hooks.find_hook('pre_gen_project') is None assert hooks.find_hook('post_gen_project') is None
def test_hook_not_found(self): with utils.work_in(self.repo_path): assert hooks.find_hook("unknown_hook") is None
def test_ignore_hook_backup_files(monkeypatch, dir_with_hooks): # Change the current working directory that contains `hooks/` monkeypatch.chdir(dir_with_hooks) assert hooks.find_hook('pre_gen_project') is None assert hooks.find_hook('post_gen_project') is None