Mercurial > libervia-backend
comparison tests/unit/test_plugin_xep_0320.py @ 4285:f1d0cde61af7
tests (unit): fix tests + black reformatting.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 14 Jul 2024 17:42:53 +0200 |
parents | 4b842c1fb686 |
children |
comparison
equal
deleted
inserted
replaced
4284:3a550e9a2b55 | 4285:f1d0cde61af7 |
---|---|
38 | 38 |
39 expected_ice_data = { | 39 expected_ice_data = { |
40 "fingerprint": { | 40 "fingerprint": { |
41 "hash": "sha-256", | 41 "hash": "sha-256", |
42 "setup": "active", | 42 "setup": "active", |
43 "fingerprint": | 43 "fingerprint": "6D:8F:6A:53:A3:7E:10:B2:58:16:AB:A3:92:6F:8A:5B:2D:55:1C:" |
44 "6D:8F:6A:53:A3:7E:10:B2:58:16:AB:A3:92:6F:8A:5B:2D:55:1C:" | |
45 "FB:2F:E3:6E:94:FE:4F:4E:FE:D4:77:49:B6", | 44 "FB:2F:E3:6E:94:FE:4F:4E:FE:D4:77:49:B6", |
46 }, | 45 }, |
47 } | 46 } |
48 | 47 |
49 assert ice_data == expected_ice_data | 48 assert ice_data == expected_ice_data |
57 | 56 |
58 ice_data = { | 57 ice_data = { |
59 "fingerprint": { | 58 "fingerprint": { |
60 "hash": "sha-256", | 59 "hash": "sha-256", |
61 "setup": "active", | 60 "setup": "active", |
62 "fingerprint": | 61 "fingerprint": "6D:8F:6A:53:A3:7E:10:B2:58:16:AB:A3:92:6F:8A:5B:2D:55:1C:" |
63 "6D:8F:6A:53:A3:7E:10:B2:58:16:AB:A3:92:6F:8A:5B:2D:55:1C:" | |
64 "FB:2F:E3:6E:94:FE:4F:4E:FE:D4:77:49:B6", | 62 "FB:2F:E3:6E:94:FE:4F:4E:FE:D4:77:49:B6", |
65 }, | 63 }, |
66 } | 64 } |
67 | 65 |
68 result = xep_0320._build_transport_trigger(transport_elt, ice_data) | 66 result = xep_0320._build_transport_trigger(transport_elt, ice_data) |
69 | 67 |
70 expected_transport_elt = xml_tools.parse( | 68 expected_transport_elt = xml_tools.parse( |
71 f"<transport><fingerprint xmlns='{NS_JINGLE_DTLS}' hash='sha-256' " | 69 f"<transport><fingerprint xmlns='{NS_JINGLE_DTLS}' hash='sha-256' " |
72 "setup='active'>6D:8F:6A:53:A3:7E:10:B2:58:16:AB:A3:92:6F:8A:5B:2D:55:1C:FB:" | 70 "setup='active'>6D:8F:6A:53:A3:7E:10:B2:58:16:AB:A3:92:6F:8A:5B:2D:55:1C:FB:" |
73 "2F:E3:6E:94:FE:4F:4E:FE:D4:77:49:B6</fingerprint></transport>""" | 71 "2F:E3:6E:94:FE:4F:4E:FE:D4:77:49:B6</fingerprint></transport>" |
72 "" | |
74 ) | 73 ) |
75 | 74 |
76 assert transport_elt.toXml() == expected_transport_elt.toXml() | 75 assert transport_elt.toXml() == expected_transport_elt.toXml() |
77 assert result | 76 assert result |