comparison tests/e2e/libervia-cli/test_libervia-cli.py @ 3731:7e51cfc36d4e

tests (e2e/CLI/set_get): fix RSM request: items are stored in chronological order in Pubsub, and as we want the more recent one, we need to set `before=''`. Otherwise, we can get a wrong item from a previous test.
author Goffi <goffi@goffi.org>
date Mon, 31 Jan 2022 18:35:52 +0100
parents eeb8be32d644
children a75874df92b8
comparison
equal deleted inserted replaced
3730:43cc8c27adc7 3731:7e51cfc36d4e
187 class TestLiberviaCliBlog: 187 class TestLiberviaCliBlog:
188 MICROBLOG_NS = "urn:xmpp:microblog:0" 188 MICROBLOG_NS = "urn:xmpp:microblog:0"
189 189
190 def test_set_get(self, li_json): 190 def test_set_get(self, li_json):
191 li.blog.set(_in="markdown **bold** [link](https://example.net)") 191 li.blog.set(_in="markdown **bold** [link](https://example.net)")
192 item_data = li_json.blog.get(max=1) 192 item_data = li_json.blog.get(max=1, before="")
193 item = item_data[0][0] 193 item = item_data[0][0]
194 metadata = item_data[1] 194 metadata = item_data[1]
195 assert metadata['service'] == "account1@server1.test" 195 assert metadata['service'] == "account1@server1.test"
196 assert metadata['node'] == self.MICROBLOG_NS 196 assert metadata['node'] == self.MICROBLOG_NS
197 assert metadata['rsm'].keys() <= {"first", "last", "index", "count"} 197 assert metadata['rsm'].keys() <= {"first", "last", "index", "count"}