File: test_enum.py

package info (click to toggle)
python-rapidjson 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,368 kB
  • sloc: cpp: 3,332; python: 1,990; makefile: 106
file content (19 lines) | stat: -rw-r--r-- 473 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
# :Project:   python-rapidjson -- Test on stdlib enums
# :Created:   mer 27 mar 2019 08:13:23 CET
# :Author:    Lele Gaifax <lele@metapensiero.it>
# :License:   MIT License
# :Copyright: © 2019, 2020 Lele Gaifax
#

import enum

import rapidjson as rj


def test_intenums_as_ints():
    class IE(enum.IntEnum):
        val = 123
        bigval = 123123123123123123123123

    assert rj.dumps([IE.val, IE.bigval]) == "[123,123123123123123123123123]"