diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2022-04-01 16:10:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 16:10:31 +0100 |
commit | 33ebee47e4e96a2b6fdf72091769e59034dc550f (patch) | |
tree | e77cad2918fd13cd14100e8e7f2e0856900a69ca /tests/test_visibility.py | |
parent | Default to `private` room visibility rather than `public` when a client does ... (diff) | |
download | synapse-33ebee47e4e96a2b6fdf72091769e59034dc550f.tar.xz |
Remove redundant `get_success` calls in test code (#12346)
There are a bunch of places we call get_success on an immediate value, which is unnecessary. Let's rip them out, and remove the redundant functionality in get_success and friends.
Diffstat (limited to 'tests/test_visibility.py')
-rw-r--r-- | tests/test_visibility.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/test_visibility.py b/tests/test_visibility.py index a02fd4f79a..d0230f9ebb 100644 --- a/tests/test_visibility.py +++ b/tests/test_visibility.py @@ -48,17 +48,15 @@ class FilterEventsForServerTestCase(unittest.HomeserverTestCase): # # before we do that, we persist some other events to act as state. - self.get_success(self._inject_visibility("@admin:hs", "joined")) + self._inject_visibility("@admin:hs", "joined") for i in range(0, 10): - self.get_success(self._inject_room_member("@resident%i:hs" % i)) + self._inject_room_member("@resident%i:hs" % i) events_to_filter = [] for i in range(0, 10): user = "@user%i:%s" % (i, "test_server" if i == 5 else "other_server") - evt = self.get_success( - self._inject_room_member(user, extra_content={"a": "b"}) - ) + evt = self._inject_room_member(user, extra_content={"a": "b"}) events_to_filter.append(evt) filtered = self.get_success( @@ -76,10 +74,10 @@ class FilterEventsForServerTestCase(unittest.HomeserverTestCase): def test_filter_outlier(self) -> None: # outlier events must be returned, for the good of the collective federation - self.get_success(self._inject_room_member("@resident:remote_hs")) - self.get_success(self._inject_visibility("@resident:remote_hs", "joined")) + self._inject_room_member("@resident:remote_hs") + self._inject_visibility("@resident:remote_hs", "joined") - outlier = self.get_success(self._inject_outlier()) + outlier = self._inject_outlier() self.assertEqual( self.get_success( filter_events_for_server(self.storage, "remote_hs", [outlier]) @@ -88,7 +86,7 @@ class FilterEventsForServerTestCase(unittest.HomeserverTestCase): ) # it should also work when there are other events in the list - evt = self.get_success(self._inject_message("@unerased:local_hs")) + evt = self._inject_message("@unerased:local_hs") filtered = self.get_success( filter_events_for_server(self.storage, "remote_hs", [outlier, evt]) @@ -112,19 +110,19 @@ class FilterEventsForServerTestCase(unittest.HomeserverTestCase): # change in the middle of them. events_to_filter = [] - evt = self.get_success(self._inject_message("@unerased:local_hs")) + evt = self._inject_message("@unerased:local_hs") events_to_filter.append(evt) - evt = self.get_success(self._inject_message("@erased:local_hs")) + evt = self._inject_message("@erased:local_hs") events_to_filter.append(evt) - evt = self.get_success(self._inject_room_member("@joiner:remote_hs")) + evt = self._inject_room_member("@joiner:remote_hs") events_to_filter.append(evt) - evt = self.get_success(self._inject_message("@unerased:local_hs")) + evt = self._inject_message("@unerased:local_hs") events_to_filter.append(evt) - evt = self.get_success(self._inject_message("@erased:local_hs")) + evt = self._inject_message("@erased:local_hs") events_to_filter.append(evt) # the erasey user gets erased |