'Register an host already registered, check that result is
unchanged'

def test_already_registered(self):

    set_module_args({'activationkey': 'key', 'username': 'user', 'password': 'pass'})
    responses = []
    with patch.object(basic.AnsibleModule, 'run_command') as run_command:
        with patch.object(rhn_register.Rhn, 'is_registered', PropertyMock(return_value=True)) as mock_systemid:
            with mock_request(responses) as req:
                with self.assertRaises(AnsibleExitJson) as result:
                    self.module.main()
                self.assertFalse(result.exception.args[0]['changed'])
            self.assertFalse(req.called)
        self.assertEqual(mock_systemid.call_count, 1)
    self.assertEqual(self.mock_enable.call_count, 0)
    self.assertFalse(run_command.called)
