def METHOD_NAME(self) -> None:
    """
    The script will fetch a nonce, and then generate a MAC with it, and then
    post that MAC.
    """
    def get(url: str, verify: Optional[bool] = None) -> Mock:
        r = Mock()
        r.status_code = 200
        r.json = lambda: {"nonce": "a"}
        return r
    def post(
        url: str, json: Optional[JsonDict] = None, verify: Optional[bool] = None
    ) -> Mock:
        # Make sure we are sent the correct info
        assert json is not None
        self.assertEqual(json["username"], "user")
        self.assertEqual(json["password"], "pass")
        self.assertEqual(json["nonce"], "a")
        # We want a 40-char hex MAC
        self.assertEqual(len(json["mac"]), 40)
        r = Mock()
        r.status_code = 200
        return r
    requests = Mock()
    requests.get = get
    requests.post = post
    # The fake stdout will be written here
    out: List[str] = []
    err_code: List[int] = []
    with patch("synapse._scripts.register_new_matrix_user.requests", requests):
        request_registration(
            "user",
            "pass",
            "matrix.org",
            "shared",
            admin=False,
            _print=out.append,
            exit=err_code.append,
        )
    # We should get the success message making sure everything is OK.
    self.assertIn("Success!", out)
    # sys.exit shouldn't have been called.
    self.assertEqual(err_code, [])