-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added config reset test fixture (empty for Demo) #35
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,13 @@ def mk_gnmi_if_path(path_str, if_state_str="", if_id=None): | |
path_str = path_str.format(if_state_str, if_id) | ||
return make_gnmi_path(path_str) | ||
|
||
def _do_reset_cfg(self): | ||
raise NotImplementedError | ||
|
||
@pytest.fixture | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking about it, do we need extra fixture? I know it is slightly different, but for now adding |
||
def reset_cfg(self): | ||
self._do_reset_cfg() | ||
|
||
|
||
class AdapterTests(GrpcBase): | ||
def test_capabilities(self, request): | ||
|
@@ -561,6 +568,7 @@ def test_subscribe_stream_sample(self, request, data_type): | |
datatype=datatype_str_to_int(data_type), | ||
sample_interval=1000, read_count=2) | ||
|
||
@pytest.mark.usefixtures("reset_cfg") | ||
def test_set(self, request): | ||
log.info("testing set") | ||
if_id = 8 | ||
|
@@ -590,6 +598,7 @@ def test_set(self, request): | |
AdapterTests.assert_set_response(response.response[0], | ||
(paths[0], gnmi_pb2.UpdateResult.UPDATE)) | ||
|
||
@pytest.mark.usefixtures("reset_cfg") | ||
def test_set_encoding(self, request): | ||
log.info("testing set_encoding") | ||
if_id = 8 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ class TestGrpcDemo(AdapterTests): | |
|
||
def set_adapter_type(self): | ||
self.adapter_type = AdapterType.DEMO | ||
|
||
def _do_reset_cfg(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disadvantage of making new class. just for Set. Perhaps there can be common (abstract) ConfDTests class, so |
||
pass |
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.
Why underscore, as it is not private for the class? It is overridden in derived classes.