-
Notifications
You must be signed in to change notification settings - Fork 185
fix: load cache error when CacheDecoder object is not callable #226
fix: load cache error when CacheDecoder object is not callable #226
Conversation
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
thanks for the pr, could you please add a test case? |
Ok, I will add it later:) |
hi @yliaog. I have pushed the test case, but i'm not sure there is any other better solutions to test the code |
/lgtm |
def setUpClass(cls): | ||
cls.config = base.get_e2e_configuration() | ||
|
||
def test_init_cache_from_file(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if you run the test without the fix, the test will fail, and there will be exception, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. without the fix, Discoverer.__init_cache
will raise 'CacheDecoder' object is not callable
then call self.invalidate_cache()
, finally self._write_cache()
will be called to modify Discoverer.__cache_file
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jamesgetx, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix the code snippet
self._cache = json.load(f, cls=CacheDecoder(self.client))
raise'CacheDecoder' object is not callable