How to use autohooks - 10 common examples

To help you get started, we’ve selected a few autohooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github greenbone / autohooks / tests / test_config.py View on Github external
def test_missing_pre_commit(self):
        config = AutohooksConfig({'tool': {'autohooks': {'foo': 'bar'}}})

        self.assertTrue(config.has_config())
        self.assertTrue(config.has_autohooks_config())
        self.assertTrue(config.is_autohooks_enabled())
        self.assertEqual(config.get_mode(), Mode.UNDEFINED)

        self.assertEqual(len(config.get_pre_commit_script_names()), 0)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_effective_mode(self):
        self.assertEqual(Mode.PIPENV.get_effective_mode(), Mode.PIPENV)
        self.assertEqual(Mode.PYTHONPATH.get_effective_mode(), Mode.PYTHONPATH)
        self.assertEqual(Mode.POETRY.get_effective_mode(), Mode.POETRY)
        self.assertEqual(Mode.UNDEFINED.get_effective_mode(), Mode.PYTHONPATH)
        self.assertEqual(Mode.UNKNOWN.get_effective_mode(), Mode.PYTHONPATH)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_pipenv_mode_from_string(self):
        self.assertEqual(Mode.from_string('pipenv'), Mode.PIPENV)
        self.assertEqual(Mode.from_string('PIPENV'), Mode.PIPENV)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_poetry_mode_from_string(self):
        self.assertEqual(Mode.from_string('poetry'), Mode.POETRY)
        self.assertEqual(Mode.from_string('POETRY'), Mode.POETRY)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_poetry_mode_from_string(self):
        self.assertEqual(Mode.from_string('poetry'), Mode.POETRY)
        self.assertEqual(Mode.from_string('POETRY'), Mode.POETRY)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_pipenv_mode_from_string(self):
        self.assertEqual(Mode.from_string('pipenv'), Mode.PIPENV)
        self.assertEqual(Mode.from_string('PIPENV'), Mode.PIPENV)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_invalid_mode_from_string(self):
        self.assertEqual(Mode.from_string('foo'), Mode.UNKNOWN)
        self.assertEqual(Mode.from_string(None), Mode.UNDEFINED)
        self.assertEqual(Mode.from_string(''), Mode.UNDEFINED)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_invalid_mode_from_string(self):
        self.assertEqual(Mode.from_string('foo'), Mode.UNKNOWN)
        self.assertEqual(Mode.from_string(None), Mode.UNDEFINED)
        self.assertEqual(Mode.from_string(''), Mode.UNDEFINED)
github greenbone / autohooks / tests / test_settings.py View on Github external
def test_get_pythonpath_mode_from_string(self):
        self.assertEqual(Mode.from_string('pythonpath'), Mode.PYTHONPATH)
        self.assertEqual(Mode.from_string('PYTHONPATH'), Mode.PYTHONPATH)
github greenbone / autohooks / tests / test_config.py View on Github external
def test_get_mode_pipenv(self):
        config = AutohooksConfig({'tool': {'autohooks': {'mode': 'pipenv'}}})

        self.assertTrue(config.has_config())
        self.assertTrue(config.has_autohooks_config())
        self.assertTrue(config.is_autohooks_enabled())
        self.assertEqual(config.get_mode(), Mode.PIPENV)

        self.assertEqual(len(config.get_pre_commit_script_names()), 0)