Example #1
0
    def test_module_create_build(self, jenkins_connection, test_deps):
        test_deps.return_value = None
        jenkins_connection.return_value = JenkinsMock()

        with self.assertRaises(AnsibleExitJson):
            set_module_args({
                "name": "host-check",
                "user": "******",
                "token": "xyz"
            })
            jenkins_build.main()
Example #2
0
    def test_module_stop_build_again(self, jenkins_connection, test_deps):
        test_deps.return_value = None
        jenkins_connection.return_value = JenkinsMockIdempotent()

        with self.assertRaises(AnsibleExitJson) as return_json:
            set_module_args({
                "name": "host-check",
                "build_number": "1234",
                "state": "stopped",
                "user": "******",
                "password": "******"
            })
            jenkins_build.main()

        self.assertFalse(return_json.exception.args[0]['changed'])