def METHOD_NAME(self):
    response = mock.Mock()
    response.json.side_effect = JSONDecodeError("mock-fail", "doc", 1)
    response.status_code = 500
    response.reason = "Internal Server Error"
    self.fake_store_register_key.mock.side_effect = (
        storeapi.errors.StoreKeyRegistrationError(response)
    )
    raised = self.assertRaises(
        storeapi.errors.StoreKeyRegistrationError,
        self.run_command,
        ["register-key", "default"],
        input="user@example.com\nsecret\n",
    )
    self.assertThat(
        str(raised), Equals("Key registration failed: 500 Internal Server Error")
    )