MCPcopy Index your code
hub / github.com/tensorflow/tensorboard / testSpecifiedHost

Method testSpecifiedHost

tensorboard/program_test.py:142–169  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

140 self.assertEndsWith(server.get_url(), "/test/")
141
142 def testSpecifiedHost(self):
143 one_passed = False
144 try:
145 server = program.WerkzeugServer(
146 self._StubApplication(),
147 self.make_flags(host="127.0.0.1", port=0, path_prefix=""),
148 )
149 self.assertStartsWith(server.get_url(), "http://127.0.0.1:")
150 one_passed = True
151 except (program.TensorBoardServerException, OSError, SystemExit):
152 # IPv4 is not supported or failed to bind
153 pass
154
155 try:
156 server = program.WerkzeugServer(
157 self._StubApplication(),
158 self.make_flags(host="::1", port=0, path_prefix=""),
159 )
160 self.assertStartsWith(server.get_url(), "http://[::1]:")
161 one_passed = True
162 except (program.TensorBoardServerException, OSError, SystemExit):
163 # IPv6 is not supported or failed to bind
164 pass
165
166 self.assertTrue(
167 one_passed,
168 "Neither IPv4 (127.0.0.1) nor IPv6 (::1) could be bound.",
169 )
170
171
172class SubcommandTest(tb_test.TestCase):

Callers

nothing calls this directly

Calls 2

make_flagsMethod · 0.95
get_urlMethod · 0.95

Tested by

no test coverage detected