Projet

Général

Profil

0001-tests-make-version-counting-more-determinist-in-appl.patch

Benjamin Dauvergne, 01 décembre 2022 11:00

Télécharger (2,3 ko)

Voir les différences:

Subject: [PATCH] tests: make version counting more determinist in applications
 tests (#71907)

 tests/test_application.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
tests/test_application.py
279 279
        assert b'"version_notes": "Foo bar blah."' in resp.content
280 280

  
281 281
        resp = app.get('/applications/manifest/test/versions/')
282
        assert resp.text.count('1.0') == 1
282
        versions = [e.text() for e in resp.pyquery('h3').items()]
283
        assert versions.count('1.0') == 1
283 284
        assert resp.text.count('Creating application bundle') == 1
284 285
        resp = resp.click(href='/applications/manifest/test/download/%s/' % version.pk)
285 286
        assert resp.content_type == 'application/x-tar'
......
301 302
        assert b'"version_notes": "Foo bar blahha."' in resp.content
302 303

  
303 304
        resp = app.get('/applications/manifest/test/versions/')
304
        assert resp.text.count('1.0') == 1
305
        versions = [e.text() for e in resp.pyquery('h3').items()]
306
        assert versions.count('1.0') == 1
305 307
        assert resp.text.count('Creating application bundle') == 2
306 308
        resp = resp.click(href='/applications/manifest/test/download/%s/' % same_version.pk)
307 309
        assert resp.content_type == 'application/x-tar'
......
852 854
    assert version3.creation_timestamp < version4.creation_timestamp
853 855
    assert version3.last_update_timestamp < version4.last_update_timestamp
854 856
    resp = app.get('/applications/manifest/test/versions/')
855
    assert resp.text.count('42.0') == 2
856
    assert resp.text.count('43.0') == 1
857
    versions = [e.text() for e in resp.pyquery('h3').items()]
858
    assert versions.count('42.0') == 2
859
    assert versions.count('43.0') == 1
857 860
    assert resp.text.count('Deploying application bundle') == 4
858 861

  
859 862
    def response_content(url, request):
860
-