Merge lp://qastaging/~yolanda.robla/charms/precise/keystone/unit_testing into lp://qastaging/~openstack-charmers/charms/precise/keystone/icehouse
Proposed by
Yolanda Robla
Status: | Merged |
---|---|
Merged at revision: | 79 |
Proposed branch: | lp://qastaging/~yolanda.robla/charms/precise/keystone/unit_testing |
Merge into: | lp://qastaging/~openstack-charmers/charms/precise/keystone/icehouse |
Diff against target: |
653 lines (+579/-5) 3 files modified
unit_tests/test_keystone_contexts.py (+70/-0) unit_tests/test_keystone_hooks.py (+251/-5) unit_tests/test_keystone_utils.py (+258/-0) |
To merge this branch: | bzr merge lp://qastaging/~yolanda.robla/charms/precise/keystone/unit_testing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Page | Needs Fixing | ||
Review via email:
|
Description of the change
Added unit testing
To post a comment you must log in.
You need to mock out get_local_endpoint:
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= service_ to_keystone_ clustered_ https_none_ values (unit_tests. test_keystone_ utils.TestKeyst oneUtils) ------- ------- ------- ------- ------- ------- ------- ------- ------- python2. 7/dist- packages/ mock.py" , line 1210, in patched jamespage/ src/charms/ icehouse/ keystone/ unit_tests/ test_keystone_ utils.py" , line 158, in test_add_ service_ to_keystone_ clustered_ https_none_ values add_service_ to_keystone( relation_ id=relation_ id, remote_ unit=remote_ unit) keystone_ utils.py" , line 608, in add_service_ to_keystone KeystoneManager (endpoint= get_local_ endpoint( ), keystone_ utils.py" , line 272, in get_local_endpoint api_port( api_port( 'keystone- admin') ) charmhelpers/ contrib/ hahelpers/ cluster. py", line 122, in determine_api_port charmhelpers/ contrib/ hahelpers/ cluster. py", line 59, in peer_units ids('cluster' ) or []): charmhelpers/ core/hookenv. py", line 44, in wrapper charmhelpers/ core/hookenv. py", line 213, in relation_ids subprocess. check_output( relid_cmd_ line)) or [] python2. 7/subprocess. py", line 566, in check_output python2. 7/subprocess. py", line 710, in __init__ python2. 7/subprocess. py", line 1327, in _execute_child
ERROR: test_add_
-------
Traceback (most recent call last):
File "/usr/lib/
return func(*args, **keywargs)
File "/home/
utils.
File "hooks/
manager = manager.
File "hooks/
determine_
File "hooks/
if len(peer_units()) > 0 or is_clustered():
File "hooks/
for r_id in (relation_
File "hooks/
res = func(*args, **kwargs)
File "hooks/
return json.loads(
File "/usr/lib/
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/
errread, errwrite)
File "/usr/lib/
raise child_exception
OSError: [Errno 2] No such file or directory
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= service_ to_keystone_ no_clustered_ no_https_ complete_ values (unit_tests. test_keystone_ utils.TestKeyst oneUtils) ------- ------- ------- ------- ------- ------- ------- ------- ------- python2. 7/dist- packages/ mock.py" , line 1210, in patched jamespage/ src/charms/ icehouse/ keystone/ unit_tests/ test_keystone_ utils.py" , line 196, in test_add_ service_ to_keystone_ no_clustered_ no_https_ complete_ values add_service_ to_keystone( relation_ id=relation_ id, remote_ unit=remote_ unit) keystone_ utils.py" , line 608, in add_service_ to_keystone KeystoneManager (endpoint= get_local_ endpoint( ), keystone_ utils.py" , line 272, in get_local_endpoint api_port( api_port( 'keystone- admin') ) charmhelpers/ contrib/ hahelpers/ cluster. py", line 122, in determine_api_port charmhelpers/ contrib/ hahelpers/ cluster. py", line 59, in peer_units ids('cluster' ) or []): charmhelpers/ core/hookenv. py", line 44, in wrapper charmhelpers/ core/hookenv. py", line 213, in relation_ids subprocess. check_ou. ..
ERROR: test_add_
-------
Traceback (most recent call last):
File "/usr/lib/
return func(*args, **keywargs)
File "/home/
utils.
File "hooks/
manager = manager.
File "hooks/
determine_
File "hooks/
if len(peer_units()) > 0 or is_clustered():
File "hooks/
for r_id in (relation_
File "hooks/
res = func(*args, **kwargs)
File "hooks/
return json.loads(