comparison tests/e2e/libervia-cli/test_libervia-cli.py @ 3658:9e491b2bab88

test (e2e/cli): use `max_items` instead of `max` when retrieving blog items: RSM `max` alone will return first (oldest) items, while `max_items` will return latest ones. As Libervia Pubsub as been fixed in this regard, tests are now fixed too.
author Goffi <goffi@goffi.org>
date Wed, 08 Sep 2021 11:17:51 +0200
parents d78b5eae912a
children eeb8be32d644
comparison
equal deleted inserted replaced
3657:6c87c00b344a 3658:9e491b2bab88
174 payload_md = "content in **markdown**" 174 payload_md = "content in **markdown**"
175 editor.set_filter(repr(payload_md)) 175 editor.set_filter(repr(payload_md))
176 li.blog.edit(_env=editor.env) 176 li.blog.edit(_env=editor.env)
177 assert len(editor.original_content) == 0 177 assert len(editor.original_content) == 0
178 assert editor.new_content == payload_md 178 assert editor.new_content == payload_md
179 items_data = li_json.blog.get(max=1) 179 items_data = li_json.blog.get(max_items=1)
180 last_item = items_data[0][0] 180 last_item = items_data[0][0]
181 last_item_id = last_item['id'] 181 last_item_id = last_item['id']
182 assert last_item['content'] == "content in markdown" 182 assert last_item['content'] == "content in markdown"
183 assert last_item['content_xhtml'] == ( 183 assert last_item['content_xhtml'] == (
184 "<div><p>content in <strong>markdown</strong></p></div>" 184 "<div><p>content in <strong>markdown</strong></p></div>"
185 ) 185 )
186 editor.set_filter('f"{content} extended"') 186 editor.set_filter('f"{content} extended"')
187 li.blog.edit("--last-item", _env=editor.env) 187 li.blog.edit("--last-item", _env=editor.env)
188 assert editor.original_content == payload_md 188 assert editor.original_content == payload_md
189 assert editor.new_content == f"{payload_md} extended" 189 assert editor.new_content == f"{payload_md} extended"
190 items_data = li_json.blog.get(max=1) 190 items_data = li_json.blog.get(max_items=1)
191 last_item = items_data[0][0] 191 last_item = items_data[0][0]
192 # we check that the id hasn't been modified 192 # we check that the id hasn't been modified
193 assert last_item['id'] == last_item_id 193 assert last_item['id'] == last_item_id
194 assert last_item['content'] == "content in markdown extended" 194 assert last_item['content'] == "content in markdown extended"
195 assert last_item['content_xhtml'] == ( 195 assert last_item['content_xhtml'] == (