Exemple #1
0
    def test_loading_multiple_file(self):
        with temp_directory():
            touch('.maintain.yaml')
            touch('.maintain.yml')

            with self.assertRaises(Exception):
                Configuration.load()
Exemple #2
0
 def test_validate_valid_releaser(self):
     Configuration.validate({
         'release': {
             'git': {
                 'commit_format': 'Hello World',
                 'tag_format': '{version}',
             }
         }
     })
Exemple #3
0
 def test_validate_invalid_releaser(self):
     with self.assertRaises(Exception):
         Configuration.validate({
             'release': {
                 'git': {
                     'commit_format': 'Hello World',
                     'tag_format': '{version}',
                     'unknown': 'x',
                 }
             }
         })
Exemple #4
0
 def test_loading_no_file(self):
     with temp_directory():
         configuration = Configuration.load()
         self.assertEqual(configuration.release, {})
Exemple #5
0
 def test_validate_release_releaser_object(self):
     with self.assertRaises(Exception):
         Configuration.validate({'release': {'test': []}})
Exemple #6
0
    def test_loading_file_config_maintain_yaml(self):
        with temp_directory():
            touch('.maintain/config.yaml', 'release:\n  test: {}')

            configuration = Configuration.load()
            self.assertEqual(configuration.release.get('test'), {})
Exemple #7
0
def cli(ctx, config):
    if config:
        ctx.obj = Configuration.fromfile(config)
    else:
        ctx.obj = Configuration.load()