Changeset - c6f5c3e60329
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-12-26 04:53:38
mads@kiilerich.com
Grafted from: eae4433628dd
tests: fix test_files.py json comparison to load json to struct so it is independent of serialization order

Py3 would fail the test because different ordering.
1 file changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_files.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
import json
 
import mimetypes
 
import posixpath
 

	
 
@@ -119,7 +120,7 @@ class TestFilesController(TestController
 
                                    revision='tip',
 
                                    f_path='vcs/nodes.py'),
 
                                extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
 
        assert response.body == HG_NODE_HISTORY
 
        assert json.loads(response.body) == json.loads(HG_NODE_HISTORY)
 

	
 
    def test_file_source_history_git(self):
 
        self.log_user()
 
@@ -128,7 +129,7 @@ class TestFilesController(TestController
 
                                    revision='master',
 
                                    f_path='vcs/nodes.py'),
 
                                extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
 
        assert response.body == GIT_NODE_HISTORY
 
        assert json.loads(response.body) == json.loads(GIT_NODE_HISTORY)
 

	
 
    def test_file_annotation(self):
 
        self.log_user()
 
@@ -158,7 +159,7 @@ class TestFilesController(TestController
 
                                    annotate='1'),
 
                                extra_environ={'HTTP_X_PARTIAL_XHR': '1'})
 

	
 
        assert response.body == HG_NODE_HISTORY
 
        assert json.loads(response.body) == json.loads(HG_NODE_HISTORY)
 

	
 
    def test_file_annotation_history_git(self):
 
        self.log_user()
 
@@ -169,7 +170,7 @@ class TestFilesController(TestController
 
                                    annotate=True),
 
                                extra_environ={'HTTP_X_PARTIAL_XHR': '1'})
 

	
 
        assert response.body == GIT_NODE_HISTORY
 
        assert json.loads(response.body) == json.loads(GIT_NODE_HISTORY)
 

	
 
    def test_file_authors(self):
 
        self.log_user()
 
@@ -210,7 +211,7 @@ class TestFilesController(TestController
 
                ('Content-Disposition', 'attachment; filename=%s' % filename),
 
                ('Content-Type', info[0]),
 
            ]
 
            assert response.response._headers.items() == heads
 
            assert sorted(response.response._headers.items()) == sorted(heads)
 

	
 
    def test_archival_wrong_ext(self):
 
        self.log_user()
0 comments (0 inline, 0 general)