Example #1
0
    def run(self, **options):
        path = options.get('path')
        active = options.get('active')

        self.settings.read(ignore_errors=True)
        if path:
            self.settings.update({
                'path': str(path)
            }).save()
            self.makedirs(get_user_home(path))
        self.green(
            texts.LOG_IPROFILE_INITIALIZED.format(
                path or 'iprofiles'
            )
        )
        if active:
            if not Profile(active).exists():
                self.red(texts.ERROR_PROFILE_DOESNT_EXIST.format(active))
                return
            self.activate(path or 'iprofiles', active)
        else:
            self.activate(path or 'iprofiles')
Example #2
0
def test_utils():
    assert '~' not in get_user_home('~/test')
    assert echo_plain_red('test') is None