0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-09-24 10:38:59 +02:00
synapse/tests
Eric Eastwood e3db7b2d81
Sliding Sync: Easier to understand timeline assertions in tests (#17511)
Added `_assertTimelineEqual(...)` because I got fed up trying to
understand the crazy diffs from the standard
`self.assertEqual(...)`/`self.assertListEqual(...)`

Before:
```
[FAIL]
Traceback (most recent call last):
  File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 103, in test_rooms_limited_initial_sync
    self.assertListEqual(
  File "/usr/lib/python3.12/unittest/case.py", line 1091, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/usr/lib/python3.12/unittest/case.py", line 1073, in assertSequenceEqual
    self.fail(msg)
twisted.trial.unittest.FailTest: Lists differ: ['$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0w[95 chars]isM'] != ['$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4[95 chars]nnU']

First differing element 0:
'$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0wWA'
'$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4-E'

- ['$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0wWA',
-  '$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4-E',
? ^

+ ['$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4-E',
? ^

-  '$q4PRxQ_pBZkQI1keYuZPTtExQ23DqpUI3-Lxwfj_isM']
+  '$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0wWA',
+  '$j3Xj-t2F1wH9kUHsI8X5yqS7hkdSyN2owaArfvk8nnU']
```

After:

```
[FAIL]
Traceback (most recent call last):
  File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 178, in test_rooms_limited_initial_sync
    self._assertTimelineEqual(
  File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 110, in _assertTimelineEqual
    self._assertListEqual(
  File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 79, in _assertListEqual
    self.fail(f"{diff_message}\n{message}")
twisted.trial.unittest.FailTest: Items must
Expected items to be in actual ('?' = missing expected items):
 [
   (10, master) $w-BoqW1PQQFU4TzVJW5OIelugxh0mY12wrfw6mbC6D4 (m.room.message) activity4
   (11, master) $sSidTZf1EOQmCVDU4mrH_1-bopMQhwcDUO2IhoemR6M (m.room.message) activity5
?  (12, master) $bgOcc3D-2QSkbk4aBxKVyOOQJGs7ZuncRJwG3cEANZg (m.room.member, @user1:test) join
 ]
Actual ('+' = found expected items):
 [
+  (11, master) $sSidTZf1EOQmCVDU4mrH_1-bopMQhwcDUO2IhoemR6M (m.room.message) activity5
+  (10, master) $w-BoqW1PQQFU4TzVJW5OIelugxh0mY12wrfw6mbC6D4 (m.room.message) activity4
   (9, master) $FmCNyc11YeFwiJ4an7_q6H0LCCjQOKd6UCr5VKeXXUw (m.room.message, None) activity3
 ]
```
2024-08-05 13:20:15 -05:00
..
api Add a short sleep if the request is rate-limited (#17210) 2024-05-18 12:03:30 +01:00
app Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
appservice Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
config Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
crypto Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
events Add event.internal_metadata.instance_name (#17300) 2024-06-13 11:32:50 -05:00
federation Support MSC3916 by adding a federation /thumbnail endpoint and authenticated _matrix/client/v1/media/thumbnail endpoint (#17388) 2024-07-08 10:11:20 +01:00
handlers Sliding Sync: Update filters to be robust against remote invite rooms (#17450) 2024-07-30 13:20:29 -05:00
http Support MSC3916 by adding _matrix/client/v1/media/download endpoint (#17365) 2024-07-02 14:07:04 +01:00
logging Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
media Handle remote download responses with UNKNOWN_LENGTH more gracefully (#17439) 2024-07-16 11:13:55 +01:00
metrics Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
module_api Require the 'from' parameter for /notifications be an integer (#17283) 2024-06-19 10:05:39 +01:00
push Finish up work to allow per-user feature flags (#17392) 2024-07-05 13:02:35 +01:00
replication Fix bug in sliding sync when using old DB. (#17398) 2024-07-08 20:30:23 +01:00
rest Sliding Sync: Easier to understand timeline assertions in tests (#17511) 2024-08-05 13:20:15 -05:00
scripts Update license headers 2023-11-21 15:29:58 -05:00
server_notices Update license headers 2023-11-21 15:29:58 -05:00
state Update license headers 2023-11-21 15:29:58 -05:00
storage Order heroes by stream_ordering (as spec'ed) (#17435) 2024-07-17 13:10:15 -05:00
test_utils Add rooms.required_state to Sliding Sync /sync (#17342) 2024-07-04 12:25:36 -05:00
types Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
util Speed up SS room sorting (#17468) 2024-07-23 14:03:14 +01:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
server.py Merge branch 'master' into develop 2024-07-30 17:10:46 +01:00
test_distributor.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_event_auth.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_federation.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_mau.py Update license headers 2023-11-21 15:29:58 -05:00
test_phone_home.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_rust.py Add missing type hints to tests. (#15027) 2023-02-08 19:52:37 +00:00
test_server.py Upgrade locked dependency on Twisted to 24.7.0rc1. (#17502) 2024-07-30 15:23:23 +01:00
test_state.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_terms_auth.py Update license headers 2023-11-21 15:29:58 -05:00
test_test_utils.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_types.py Fix bug where sync could get stuck when using workers (#17438) 2024-07-15 16:13:04 +01:00
test_visibility.py Include user membership on events (#17282) 2024-06-13 21:45:54 +00:00
unittest.py Add room subscriptions to Sliding Sync /sync (#17432) 2024-07-15 10:37:10 +01:00
utils.py Improve lock performance when a lot of locks are waiting (#16840) 2024-03-14 13:49:54 +00:00