• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ringcentral / ringcentral-python / 139

pending completion
139

push

travis-ci-com

DaKingKong
increase version number

550 of 615 relevant lines covered (89.43%)

1.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.74
/ringcentral/http/json_object.py
1
# !/usr/bin/env python
2
# encoding: utf-8
3
from ..core import iterator
2✔
4

5

6
PYTHON_KEYWORDS = (
2✔
7
    "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", "assert", "else", "if", "pass", "yield",
8
    "break", "except", "import", "rint", "class", "exec", "in", "raise", "continue", "finally", "is", "return", "def",
9
    "for", "lambda", "try",)
10

11

12
class JsonObject:
2✔
13
    def __init__(self):
2✔
14
        pass
2✔
15

16

17
def safe_name(n):
2✔
18
    if n in PYTHON_KEYWORDS:
2✔
19
        return n + "_"
×
20
    else:
21
        return n
2✔
22

23

24
def unfold(d):
2✔
25
    if isinstance(d, dict):
2✔
26
        o = JsonObject()
2✔
27
        for k, v in iterator(d):
2✔
28
            o.__dict__[safe_name(k)] = unfold(v)
2✔
29
        return o
2✔
30
    elif isinstance(d, list):
2✔
31
        o = [unfold(x) for x in d]
2✔
32
        return o
2✔
33
    else:
34
        return d
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc