How to use the autohooks.config.PoetryConfig function in autohooks

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_load_from_toml_file(self):
        config_path = get_test_config_path('pyproject.test1.toml')
        self.assertTrue(config_path.is_file())

        config = PoetryConfig.from_pyproject_toml(config_path)

        self.assertTrue(config.has_config())
        self.assertTrue(config.has_poetry_config())
        self.assertEqual(config.get_name(), 'foo')
        self.assertEqual(config.get_version(), '1.0.1a0')
        self.assertEqual(config.get_description(), 'Foo Bar')
        self.assertEqual(config.get_homepage(), 'https://foo.bar')
        self.assertEqual(config.get_repository(), 'https://bar.foo')
        self.assertEqual(config.get_license(), 'GPL-3.0-or-later')

        self.assertEqual(len(config.get_classifiers()), 12)
        self.assertEqual(config.get_scripts(), {'foo': 'foo.cli:main'})
github greenbone / autohooks / tests / test_config.py View on Github external
def test_empty_config_dict(self):
        config = PoetryConfig({'foo': 'bar'})

        self.assertTrue(config.has_config())
        self.assertIsNone(config.get_name())
        self.assertIsNone(config.get_version())
        self.assertIsNone(config.get_description())
        self.assertIsNone(config.get_homepage())
        self.assertIsNone(config.get_repository())
        self.assertIsNone(config.get_license())

        self.assertEqual(len(config.get_classifiers()), 0)
github greenbone / autohooks / tests / test_config.py View on Github external
def test_empty_config(self):
        config = PoetryConfig()

        self.assertFalse(config.has_config())
        self.assertIsNone(config.get_name())
        self.assertIsNone(config.get_version())
        self.assertIsNone(config.get_description())
        self.assertIsNone(config.get_homepage())
        self.assertIsNone(config.get_repository())
        self.assertIsNone(config.get_license())

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