From 900cc9ce72c0b341995593f5493edd1b28c5c31f Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Mon, 8 Jul 2019 11:19:46 -0400 Subject: [PATCH] Test another important property of the storage server. --- .../tests/test_plugin.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/_secureaccesstokenauthorizer/tests/test_plugin.py b/src/_secureaccesstokenauthorizer/tests/test_plugin.py index ef1827d..3d83cad 100644 --- a/src/_secureaccesstokenauthorizer/tests/test_plugin.py +++ b/src/_secureaccesstokenauthorizer/tests/test_plugin.py @@ -150,3 +150,29 @@ class PluginTests(TestCase): ), ), ) + + + @given(configurations()) + def test_returns_hashable(self, configuration): + """ + The storage server attached to the result of + ``storage_server.get_storage_server`` is hashable for use as a Python + dictionary key. + + This is another requirement of Foolscap. + """ + storage_server_deferred = storage_server.get_storage_server( + configuration, + get_anonymous_storage_server, + ) + broker = Broker(None) + broker.makeConnection(StringTransport()) + self.expectThat( + storage_server_deferred, + succeeded( + AfterPreprocessing( + lambda ann: hash(ann.storage_server), + Always(), + ), + ), + ) -- GitLab