def test_properties__setters(self):
        def read_from_conf(prop):
            conf = json.loads(self.lily_dir.join('config.json').read())

            return conf[prop]

        config = Config()

        # -- version
        config.version = '9.9.1'
        assert read_from_conf('version') == '9.9.1'

        # -- next_version
        config.next_version = '9.0.8'
        assert read_from_conf('next_version') == '9.0.8'

        # -- src_dir
        config.src_dir = 'entity_service'
        assert read_from_conf('src_dir') == 'entity_service'

        # -- last_commit_hash
        config.last_commit_hash = 'f7d87cd78'
        assert read_from_conf('last_commit_hash') == 'f7d87cd78'

        # -- next_last_commit_hash
        config.next_last_commit_hash = 'f7d87cd78'
        assert read_from_conf('next_last_commit_hash') == 'f7d87cd78'
Exemple #2
0
def push_upgraded_version():
    """Push Upgraded version and all of its artefacts.

    - add commit with artefacts

    - tag branch with the version of repo

    - push changes to the remote

    """

    config = Config()
    repo = Repo()

    # -- version
    config.version = config.next_version
    config.next_version = None

    # -- last_commit_hash
    config.last_commit_hash = config.next_last_commit_hash
    config.next_last_commit_hash = None

    # -- add all artefacts coming from the post upgrade step
    repo.add_all()
    repo.commit('VERSION: {}'.format(config.version))
    repo.push()

    logger.info(f'''
        - Version upgraded to: {config.version}
    ''')