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

Geoffery10 / Discord-Role-Manager / 27890456328
90%

Build:
DEFAULT BRANCH: main
Ran 21 Jun 2026 02:05AM UTC
Jobs 1
Files 23
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Jun 2026 02:04AM UTC coverage: 68.519% (+2.5%) from 66.039%
27890456328

push

github

Geoffery10
Add test_main.py — main.py pure helpers now at 35% coverage

8 tests covering the two pure functions in main.py:

  load_roles(path='roles.json')
    - reads the guild-scoped {guild_id: {emoji: role_id}} format
    - upgrades the legacy flat {emoji: role_id} format to guild-scoped
      under the canonical main guild id (254779349352448001)
    - respects a custom path argument

  flatten_roles(roles_dict)
    - flattens nested {guild_id: {emoji: role_id}} → {emoji: role_id}
    - coerces string role_ids (from JSON) to int for use as discord IDs
    - passes int role_ids through unchanged
    - returns {} for empty input
    - keeps the last value when two guilds define the same emoji key
      (pins this documented behavior)

main.py went from 0% to 35%. The remaining 65% is the MyClient
event handlers and slash commands (add_birthday, next_birthday,
update_db) which need an active discord gateway to exercise properly
— out of scope for this phase.

Note: main.py contains DUPLICATED definitions of load_roles and
flatten_roles (lines 26-32 and 34-39 are dead code; Python uses
the definitions at lines 42-48 and 51-56). Worth cleaning up in a
follow-up commit.

Importing main.py has module-level side effects (reads roles.json,
calls client.run(TOKEN)). The roles_json fixture writes a roles.json
into a tmp dir, and the import_main fixture monkeypatches
discord.Client.run to a no-op so the module can be imported in a
test environment without spinning up a real bot.

56 of 56 new or added lines in 2 files covered. (100.0%)

4 existing lines in 1 file now uncovered.

1615 of 2357 relevant lines covered (68.52%)

0.69 hits per line

Coverage Regressions

Lines Coverage ∆ File
4
93.75
-6.25% utils/logger.py
Jobs
ID Job ID Ran Files Coverage
1 27890456328.1 21 Jun 2026 02:05AM UTC 23
68.52
GitHub Action Run
Source Files on build 27890456328
  • Tree
  • List 23
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27890456328
  • c9e26236 on github
  • Prev Build on main (#27890336076)
  • Next Build on main (#27890672416)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc