def test_get_peer_host(self): """Validates caller host (from X-Host-Token) is stored in auth context.""" tok = host_token.create_host_token('host-name.domain') self.call('127.0.0.1', '*****@*****.**', headers={'X-Host-Token-V1': tok}) self.assertEqual('host-name.domain', api.get_peer_host())
def get(self): self.response.write(api.get_peer_host() or '<none>')