Refactor event tests#1961
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1961 +/- ##
==========================================
+ Coverage 88.63% 88.86% +0.23%
==========================================
Files 149 152 +3
Lines 7186 7283 +97
==========================================
+ Hits 6369 6472 +103
+ Misses 817 811 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
They made the tests difficult to understand
Before we tested 3 or 4 different things in one test, now each assumption is one
feed7ed to
eac9ee2
Compare
lunkwill42
left a comment
There was a problem hiding this comment.
Overall a good restructure, though a couple of small things appear to need fixing...
Also, there is some setUp() logic that seems duplicated between classes. In lack of pytest fixtures (sigh), perhaps some of these could/should be factored out to a mixin class (I don't consider this a blocker for the PR, though, it's just a style hint)
| self.assertFalse(self.stateless_incident.stateful) | ||
| self.assertFalse(self.stateless_incident.open) | ||
|
|
||
| def test_when_posting_reopen_event_then_incident_does_not_change(self): |
There was a problem hiding this comment.
This appears to be a sibling of test_when_posting_close_event_for_stateless_incident_then_incident_does_not_change(), but makes no mention of _for_stateless_incident in its name..
There was a problem hiding this comment.
Yes, because it's been moved to the class EventAPIStatelessIncidentTests, so we have the stateless in the class name already
|



Scope and purpose
Dependent on #1504. After I added tests to this file in that pull request I decided it is time to make this test easier to read and for new tests to be added if wanted.
Contributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Argus can be found in the
Development docs.