Strengthen logging assertions for refused REST activations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Open netbox_scripts/tests/api/test_projects.py and extend test_a_refused_activation_returns_a_fixed_message_and_logs_its_reason. Read the existing assertLogs() checks, then assert that the captured record has WARNING level and no exception information. Run that test; it is done when it still checks the message and also fails if the log level or exception information is wrong.
Written by the indexing model from the issue text.
Description
Proposed Changes
Extend test_a_refused_activation_returns_a_fixed_message_and_logs_its_reason in netbox_scripts/tests/api/test_projects.py to assert that the captured log record has a WARNING level and contains no exception information, in addition to the existing message assertions.
Justification
Expected activation refusals are logged at WARNING without a traceback. However, assertLogs() also captures records at higher severity levels, so changing the logging call to logger.exception() would not cause the existing tests to fail.
Explicitly checking the log level and the absence of exception information ensures that this intended behavior remains covered by the tests.
- Dominant language
- Python
- Stars
- 8
- Forks
- 0
- Avg merge
- 12h 46m
- Merged PRs (30d)
- 83
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from netbox-community/netbox-scripts
-
app: scripts status: backlog type: documentation
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
netbox-community/netbox-scripts#238 ·
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: documentation
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
netbox-community/netbox-scripts#236 ·
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: documentation
Difficulty 1/5 Under an hour Newbie friendliness 88/100
netbox-community/netbox-scripts#235 ·
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: documentation
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
netbox-community/netbox-scripts#233 ·
Maintainers usually reply within 1 day
-
app: scripts complexity: medium status: backlog type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
netbox-community/netbox-scripts#229 ·
Maintainers usually reply within 1 day
All issues in netbox-community/netbox-scripts
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
LmeSzinc/AzurLaneAutoScript#6194 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
micronaut-projects/micronaut-core#14585 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
langgenius/graphon#443 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100