MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / test_cache_failure

Method test_cache_failure

tensorboard/auth_test.py:37–52  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 self.assertEqual(call_count, 1)
36
37 def test_cache_failure(self):
38 call_count = 0
39
40 class FailureProvider(auth.AuthProvider):
41 def authenticate(self, environ):
42 nonlocal call_count
43 call_count += 1
44 raise RuntimeError()
45
46 providers = {FailureProvider: FailureProvider()}
47 auth_ctx = auth.AuthContext(providers, {})
48 with self.assertRaises(RuntimeError):
49 auth_ctx.get(FailureProvider)
50 with self.assertRaises(RuntimeError):
51 auth_ctx.get(FailureProvider)
52 self.assertEqual(call_count, 2)
53
54
55if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
FailureProviderClass · 0.85

Tested by

no test coverage detected