def METHOD_NAME(self, gethostname_mock):
    # given
    token = (
        "eyJhcGlfYWRkcmVzcyI6Imh0dHBzOi8vdWkuc3RhZ2UubmVwdHVuZS5tbCIsImFwaV91cmwiOiJodHRwczovL3VpLn"
        "N0YWdlLm5lcHR1bmUuYWkiLCJhcGlfa2V5IjoiOTgzOGQ5NTQtNDAwMy0xMWU5LWJmNTAtMjMxOTgzNTVkYTY2In0="
    )
    gethostname_mock.side_effect = socket.gaierror
    # expect
    with self.assertRaises(CannotResolveHostname):
        HostedNeptuneBackendApiClient(token)