Skip to content
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 some mock test to cover 'sds_sync/__init__.py' file. #698

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aruniiird
Copy link

Please note, this is not complete and has some failures.
Contains some minor changes made to 'sds_sync/init.py' itself.

this is not complete and has some failures.
Some minor changes made to 'sds_sync/__init__.py' itself.
@aruniiird aruniiird requested review from shtripat and a team as code owners September 3, 2018 10:55
@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

1 similar comment
@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?


@patch.object(BaseObject, "save")
@patch.object(BaseObject, "load_all")
@patch.object(event_utils, "emit_event")
@patch.object(BaseObject, "hash_compare_with_central_store")
@patch.object(etcd_utils, "refresh")
def test_brick_status_alert(
compare, refresh, emit_event, load_all, save
refresh, compare, emit_event, load_all, save
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have any effect by changing the order only?

sds_sync = importlib.import_module(
'tendrl.gluster_integration.sds_sync'
)
with patch.object(etcd_utils, "read") as utils_read:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GowthamShanmugam can you please check this and suggest?

# below is a dummy assert, which should be replaced by
# other assertions to get the code coverage
# and check / mock some exceptions
subproc_call.assert_called_once()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to have another PR to take care?

@aruniiird
Copy link
Author

aruniiird commented Sep 4, 2018 via email

@shtripat
Copy link
Member

shtripat commented Sep 5, 2018

E AttributeError: 'NoneType' object has no attribute 'integration_id'

Shouldn't we mock etcd_utils.read and return a valid value for key /clusters/{int-id}/_sync_now?

@aruniiird
Copy link
Author

aruniiird commented Sep 5, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants