File: test_roundtrip.py

package info (click to toggle)
python-orjson 3.10.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,180 kB
  • sloc: ansic: 11,270; python: 6,658; sh: 135; makefile: 9
file content (173 lines) | stat: -rw-r--r-- 3,994 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import orjson

from .util import read_fixture_str


class TestJsonChecker:
    def _run_roundtrip_json(self, filename):
        data = read_fixture_str(filename, "roundtrip")
        assert orjson.dumps(orjson.loads(data)) == data.encode("utf-8")

    def test_roundtrip001(self):
        """
        roundtrip001.json
        """
        self._run_roundtrip_json("roundtrip01.json")

    def test_roundtrip002(self):
        """
        roundtrip002.json
        """
        self._run_roundtrip_json("roundtrip02.json")

    def test_roundtrip003(self):
        """
        roundtrip003.json
        """
        self._run_roundtrip_json("roundtrip03.json")

    def test_roundtrip004(self):
        """
        roundtrip004.json
        """
        self._run_roundtrip_json("roundtrip04.json")

    def test_roundtrip005(self):
        """
        roundtrip005.json
        """
        self._run_roundtrip_json("roundtrip05.json")

    def test_roundtrip006(self):
        """
        roundtrip006.json
        """
        self._run_roundtrip_json("roundtrip06.json")

    def test_roundtrip007(self):
        """
        roundtrip007.json
        """
        self._run_roundtrip_json("roundtrip07.json")

    def test_roundtrip008(self):
        """
        roundtrip008.json
        """
        self._run_roundtrip_json("roundtrip08.json")

    def test_roundtrip009(self):
        """
        roundtrip009.json
        """
        self._run_roundtrip_json("roundtrip09.json")

    def test_roundtrip010(self):
        """
        roundtrip010.json
        """
        self._run_roundtrip_json("roundtrip10.json")

    def test_roundtrip011(self):
        """
        roundtrip011.json
        """
        self._run_roundtrip_json("roundtrip11.json")

    def test_roundtrip012(self):
        """
        roundtrip012.json
        """
        self._run_roundtrip_json("roundtrip12.json")

    def test_roundtrip013(self):
        """
        roundtrip013.json
        """
        self._run_roundtrip_json("roundtrip13.json")

    def test_roundtrip014(self):
        """
        roundtrip014.json
        """
        self._run_roundtrip_json("roundtrip14.json")

    def test_roundtrip015(self):
        """
        roundtrip015.json
        """
        self._run_roundtrip_json("roundtrip15.json")

    def test_roundtrip016(self):
        """
        roundtrip016.json
        """
        self._run_roundtrip_json("roundtrip16.json")

    def test_roundtrip017(self):
        """
        roundtrip017.json
        """
        self._run_roundtrip_json("roundtrip17.json")

    def test_roundtrip018(self):
        """
        roundtrip018.json
        """
        self._run_roundtrip_json("roundtrip18.json")

    def test_roundtrip019(self):
        """
        roundtrip019.json
        """
        self._run_roundtrip_json("roundtrip19.json")

    def test_roundtrip020(self):
        """
        roundtrip020.json
        """
        self._run_roundtrip_json("roundtrip20.json")

    def test_roundtrip021(self):
        """
        roundtrip021.json
        """
        self._run_roundtrip_json("roundtrip21.json")

    def test_roundtrip022(self):
        """
        roundtrip022.json
        """
        self._run_roundtrip_json("roundtrip22.json")

    def test_roundtrip023(self):
        """
        roundtrip023.json
        """
        self._run_roundtrip_json("roundtrip23.json")

    def test_roundtrip024(self):
        """
        roundtrip024.json
        """
        self._run_roundtrip_json("roundtrip24.json")

    def test_roundtrip025(self):
        """
        roundtrip025.json
        """
        self._run_roundtrip_json("roundtrip25.json")

    def test_roundtrip026(self):
        """
        roundtrip026.json
        """
        self._run_roundtrip_json("roundtrip26.json")

    def test_roundtrip027(self):
        """
        roundtrip027.json
        """
        self._run_roundtrip_json("roundtrip27.json")