-
Notifications
You must be signed in to change notification settings - Fork 218
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
Vui current state rebased #2752
Vui current state rebased #2752
Conversation
… will get removed eventually, and the work moved into a separate repository.
… Some cleanup will still be required here.
…y be working, but my driver is not... Still need tags, regex, PUT, and DELETE for devices.
…ed without topic replacement.
… multiple wildcards and non-symetric trees.
… Some cleanup will still be required here.
…y be working, but my driver is not... Still need tags, regex, PUT, and DELETE for devices.
…ed without topic replacement.
… multiple wildcards and non-symetric trees.
…at Exception can be used from calling code.
207d4e0
to
667e3dc
Compare
…ttron into vui_current_state_rebased
…ling for endpoints. This breaks all the tests....
…cted default value for write-all in devices endpoint.
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.
Missing treelib from the web requirements.py file.
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.
In your tests you assume your platform historian has all of the things your platform does. Or at least that is what it seems to be saying.
___________________________________________ test_handle_platforms_historians_historian_topics_get_response[Campus/Building1/Fake1/SampleBool1-True-False-False-False] ___________________________________________
mock_platform_web_service = <volttron.platform.web.platform_web_service.PlatformWebService object at 0x7f5f6f494f70>, topic = 'Campus/Building1/Fake1/SampleBool1', is_full_topic = True, read_all = False
return_routes = False, return_values = False
@pytest.mark.parametrize('topic, is_full_topic, read_all, return_routes, return_values', [
('', False, False, True, True),
('', False, True, True, True),
('Campus/Building1/Fake1', False, False, True, True),
('Campus/Building1/Fake1', False, True, True, True),
('Campus/Building1/Fake1/SampleBool1', True, False, True, True),
('Campus/Building1/Fake1/SampleBool1', True, False, False, False)
])
def test_handle_platforms_historians_historian_topics_get_response(mock_platform_web_service, topic, is_full_topic,
read_all, return_routes, return_values):
query_string = f'read-all={read_all}&routes={return_routes}&values={return_values}'
env = get_test_web_env(f'/vui/platforms/my_instance_name/historians/platform.historian/topics/{topic}',
query_string=query_string, method='GET')
vui_endpoints = VUIEndpoints(mock_platform_web_service)
vui_endpoints._rpc = _mock_historians_rpc
response = vui_endpoints.handle_platforms_historians_historian_topics(env, {})
if not read_all and not is_full_topic:
seg_number = 0 if topic == '' else len(topic.split('/'))
keys = [list_topic.split('/')[seg_number] for list_topic in HISTORIAN_TOPIC_LIST]
_log.debug(f'KEYS IS: {keys}')
check_route_options_return(response, list(set(keys)))
else:
body = json.loads(response.response[0])
assert isinstance(body, dict)
_log.debug('BODY IS:')
_log.debug(body)
for k, v in body.items():
> keys = v.keys()
E AttributeError: 'str' object has no attribute 'keys'
volttrontesting/platform/web/test_vui_endpoints.py:654: AttributeError
The above is one example of that.
Description
Draft PR for VOLTTRON User Interface (VUI) API. This is not fully covered with tests, and has some work remaining before it should be merged.
Type of change
How Has This Been Tested?
Partial coverage by unit tests for volttron.platform.web.vui_endpoints. Further tests required before merge.
Checklist: