Пример #1
0
def test_running_on_macos_ci():
    with mock.patch.dict(os.environ, {
            'SYSTEM_TEAMFOUNDATIONCOLLECTIONURI': 'url',
            'AGENT_OS': 'Darwin'
    }):
        assert running_on_ci() is True
        assert running_on_macos_ci() is True
Пример #2
0
    def __call__(self):
        if not ON_WINDOWS:
            user = getpass.getuser()
            chown_args = ['chown', user, self.token_file]

            if user != 'root' and running_on_ci():
                chown_args.insert(0, 'sudo')

            run_command(chown_args, check=True)
Пример #3
0
def test_not_running_ci():
    with EnvVars(ignore=['SYSTEM_TEAMFOUNDATIONCOLLECTIONURI']):
        with mock.patch.dict(os.environ, {'AGENT_OS': 'Linux'}):
            assert running_on_ci() is False
            assert running_on_linux_ci() is False
Пример #4
0
def test_running_on_travis():
    with mock.patch.dict(os.environ, {'TRAVIS': 'true'}):
        assert running_on_travis() is True
        assert running_on_ci() is True
Пример #5
0
def test_running_on_appveyor():
    with mock.patch.dict(os.environ, {'APPVEYOR': 'true'}):
        assert running_on_appveyor() is True
        assert running_on_ci() is True
Пример #6
0
def test_not_running_ci():
    with mock.patch.dict(os.environ, {'AGENT_OS': 'Linux'}):
        assert running_on_ci() is False
        assert running_on_linux_ci() is False