示例#1
0
    def test_triggers_the_named_pipeline(self, go_server):
        cmd = Trigger(go_server, 'Simple-Pipeline')
        cmd.run()

        go_server.pipeline.assert_called_once_with('Simple-Pipeline')
        cmd.pipeline.schedule.assert_called_once_with(
            variables=None, secure_variables=None, return_new_instance=False)
示例#2
0
    def test_trigger_with_secure_variables(self, go_server):
        cmd = Trigger(go_server, 'Moria', secure_variables='PASSCODE=Mellon')
        cmd.run()

        cmd.pipeline.schedule.assert_called_once_with(
            variables=None,
            secure_variables=dict(PASSCODE='Mellon'),
            return_new_instance=False,
        )
示例#3
0
    def test_trigger_with_variables(self, go_server):
        cmd = Trigger(go_server, 'Keymaker', variables='PIPELINE=The-Matrix')
        cmd.run()

        cmd.pipeline.schedule.assert_called_once_with(
            variables=dict(PIPELINE='The-Matrix'),
            secure_variables=None,
            return_new_instance=False,
        )
示例#4
0
    def test_doesnt_try_to_unlock_if_unlock_is_not_true(self, go_server):
        cmd = Trigger(go_server, 'Simple-Pipeline', unlock='false')
        cmd.pipeline.status.return_value = dict(locked=True)
        cmd.run()

        assert not cmd.pipeline.unlock.called
示例#5
0
    def test_tries_to_unlock_the_pipeline_if_asked(self, go_server):
        cmd = Trigger(go_server, 'Simple-Pipeline', unlock=True)
        cmd.pipeline.status.return_value = dict(locked=True)
        cmd.run()

        cmd.pipeline.unlock.assert_called_with()