def METHOD_NAME(mock_credential, expect_argument):
    AzureApplicationCredential(authority=authority)
    assert mock_credential.call_count == 1
    # N.B. if os.environ has been patched somewhere in the stack, that patch is in place here
    environment = dict(os.environ, **{EnvironmentVariables.AZURE_AUTHORITY_HOST: authority})
    with patch.dict(AzureApplicationCredential.__module__ + ".os.environ", environment, clear=True):
        AzureApplicationCredential()
    assert mock_credential.call_count == 2
    for _, kwargs in mock_credential.call_args_list:
        if expect_argument:
            actual = urlparse(kwargs["authority"])
            assert actual.scheme == "https"
            assert actual.netloc == expected_netloc
        else:
            assert "authority" not in kwargs