From: Christian Heller Date: Mon, 15 Sep 2025 13:49:22 +0000 (+0200) Subject: Extend tests, determine order of server caps listing. X-Git-Url: https://plomlompom.com/repos/do_todos?a=commitdiff_plain;h=c43d1fde467940308e8f10e94e81a3c147b2854b;p=ircplom Extend tests, determine order of server caps listing. --- diff --git a/ircplom/client.py b/ircplom/client.py index a5fe3e9..236dff9 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -701,7 +701,7 @@ class _CapsManager(_Clearable): assert acks == self._list.intersection(acks) assert set() == self._list.intersection(naks) for key, data in [_Dict.key_val_from_eq_str(entry) - for entry in self._ls]: + for entry in sorted(self._ls)]: self._dict[key].data = data self._dict[key].enabled = key in self._list return True diff --git a/test.txt b/test.txt index fd27386..af084a1 100644 --- a/test.txt +++ b/test.txt @@ -37,13 +37,32 @@ 1,2 $$$ *** Looking up your ident... 2 < :*.?.net NOTICE * :*** Looking up your hostname... 1,2 $$$ *** Looking up your hostname... -2 < :*.?.net NOTICE * :*** Found your hostname (…) -- cached... -1,2 $$$ *** Found your hostname (…) -- cached... +2 < :*.?.net NOTICE * :*** Found your hostname (baz.bar.foo) +1,2 $$$ *** Found your hostname (baz.bar.foo) 2 < :*.?.net CAP * LS : foo bar sasl=PLAIN,EXTERNAL baz 1,2 $ isupport cleared 2 > CAP REQ :sasl 2 > CAP :LIST 2 < PING :? 2 > PONG :? +2 < :*.?.net CAP ? ACK :sasl +2 < :*.?.net CAP ? LIST :cap-notify sasl +1,2 $ caps:bar:data set to: [] +1,2 $ caps:baz:data set to: [] +1,2 $ caps:foo:data set to: [] +1,2 $ caps:sasl:data set to: [] +1,2 $ caps:sasl:data set to: [PLAIN,EXTERNAL] +1,2 $ caps:sasl:enabled set to: [True] +1,2 $ sasl_auth_state set to: [attempting] +2 > AUTHENTICATE :PLAIN +2 < AUTHENTICATE + +2 > AUTHENTICATE :Zm9vAGZvbwBiYXI= +2 < :foo.bar.baz 900 foo foo!plom@baz.bar.foo foo :You are now logged in as foo +1,2 $ ?!plom@? renames foo +1,2 $ users:me:host set to: [baz.bar.foo] +1,2 $ sasl_account set to: [foo] +2 < :foo.bar.baz 903 foo :SASL authentication successful +1,2 $ sasl_auth_state set to: [SASL authentication successful] +2 > CAP :END > /quit 0 <