Example #1
0
    def test_get_config_no_default_missing_in_progress(self):
        with self.assertRaises(Exception):
            config = {
                'config': {},
                'sources': {
                    "https://gitlab.com/creekorful/test": {
                        'url': 'https://gitlab.com/creekorful/test',
                        'todo': 2424,
                    }
                }}

            get_config(config, 'https://gitlab.com/creekorful/test')
Example #2
0
    def test_get_config_missing_in_progress(self):
        config = {
            'config': {},
            'sources': {
                "https://gitlab.com/creekorful/test": {
                    'url': 'https://gitlab.com/creekorful/test',
                    'default': 42,
                    'todo': 2424,
                }
            }}

        labels, todo, in_progress = get_config(config, 'https://gitlab.com/creekorful/test')

        self.assertEqual([], labels)
        self.assertEqual(2424, todo)
        self.assertEqual(42, in_progress)
Example #3
0
    def test_get_config_with_default_labels(self):
        config = {
            'config': {
                'default_labels': [12]
            },
            'sources': {
                "https://gitlab.com/creekorful/test": {
                    'url': 'https://gitlab.com/creekorful/test',
                    'labels': [6, 24],
                    'default': 42,
                    'todo': 2121,
                    'in_progress': 2424,
                }
            }}

        labels, todo, in_progress = get_config(config, 'https://gitlab.com/creekorful/test')

        self.assertEqual([6, 24, 12], labels)
        self.assertEqual(2121, todo)
        self.assertEqual(2424, in_progress)
Example #4
0
    def test_get_config_url_not_present(self):
        with self.assertRaises(Exception):
            config = {'sources': {}}

            get_config(config, 'https://gitlab.com/creekorful/test')