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

iplweb / bpp / 18634744198

19 Oct 2025 07:00PM UTC coverage: 31.618% (-29.9%) from 61.514%
18634744198

push

github

mpasternak
Merge branch 'release/v202510.1270'

657 of 9430 branches covered (6.97%)

Branch coverage included in aggregate %.

229 of 523 new or added lines in 42 files covered. (43.79%)

11303 existing lines in 316 files now uncovered.

14765 of 39346 relevant lines covered (37.53%)

0.38 hits per line

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

4.88
src/pbn_api/utils.py
1
def rename_dict_key(data, old_key, new_key):
1✔
2
    """
3
    Recursively rename a dictionary key in a dictionary and all nested dictionaries.
4

5
    Args:
6
        data: Dictionary or any data structure that may contain dictionaries
7
        old_key: The key to be renamed
8
        new_key: The new key name
9

10
    Returns:
11
        The modified data structure with renamed keys
12
    """
UNCOV
13
    if isinstance(data, dict):
×
14
        # Create a new dictionary with renamed keys
UNCOV
15
        new_dict = {}
×
UNCOV
16
        for key, value in data.items():
×
17
            # Rename the key if it matches
UNCOV
18
            new_key_name = new_key if key == old_key else key
×
19
            # Recursively process the value
UNCOV
20
            new_dict[new_key_name] = rename_dict_key(value, old_key, new_key)
×
UNCOV
21
        return new_dict
×
UNCOV
22
    elif isinstance(data, list):
×
23
        # Process each item in the list
UNCOV
24
        return [rename_dict_key(item, old_key, new_key) for item in data]
×
25
    else:
26
        # Return the value unchanged if it's not a dict or list
UNCOV
27
        return data
×
28

29

30
def compare_dicts(d1, d2, path=""):
1✔
UNCOV
31
    diffs = []
×
UNCOV
32
    keys = set(d1.keys()) | set(d2.keys())
×
33

UNCOV
34
    for key in keys:
×
UNCOV
35
        key_path = f"{path}.{key}" if path else key
×
36

UNCOV
37
        if key not in d1:
×
38
            diffs.append(f"Key '{key_path}' missing in first dict")
×
UNCOV
39
        elif key not in d2:
×
40
            diffs.append(f"Key '{key_path}' missing in second dict")
×
41
        else:
UNCOV
42
            v1, v2 = d1[key], d2[key]
×
UNCOV
43
            if isinstance(v1, dict) and isinstance(v2, dict):
×
UNCOV
44
                diffs.extend(compare_dicts(v1, v2, key_path))
×
UNCOV
45
            elif v1 != v2:
×
46
                diffs.append(f"Value mismatch at '{key_path}': {v1!r} != {v2!r}")
×
47

UNCOV
48
    return diffs
×
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

© 2026 Coveralls, Inc