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

Add tests to cover some part of actionsmap.py #219

Conversation

@decentral1se
Copy link
Member

commented Aug 28, 2019

Linking to YunoHost/issues#1255 and YunoHost/issues#1367.

@decentral1se decentral1se force-pushed the decentral1se:add-actions-map-unit-tests branch 2 times, most recently from 170cee3 to ac2e1dc Sep 2, 2019

@decentral1se decentral1se changed the title WIP: Add tests to cover some part of actionsmap.py Add tests to cover some part of actionsmap.py Sep 4, 2019

@decentral1se

This comment has been minimized.

Copy link
Member Author

commented Sep 4, 2019

OK, this is officially "better than nothing" and I think can be reviewed/merged.

@Timost
Copy link

left a comment

I agree this is better than nothing ! A few minor comments and addition suggestions but I don't know the code base well yet.

Something that is missing is some test tooling around msignals and m18n to test the __call__ methods of the various classes. Maybe it already exists and I'm not aware of it.

test/test_actionsmap.py Outdated Show resolved Hide resolved
test/test_actionsmap.py Outdated Show resolved Hide resolved
test/test_actionsmap.py Outdated Show resolved Hide resolved
test/test_actionsmap.py Outdated Show resolved Hide resolved

with pytest.raises(TypeError):
comment.validate({}, 'b')

This comment has been minimized.

Copy link
@Timost

Timost Sep 8, 2019

Missing a test for the valid case:

Suggested change
def test_comment_parameter_valid(iface):
comment = CommentParameter(iface)
assert comment.validate('foobar', 'a') == 'foobar'

with pytest.raises(TypeError):
ask.validate({}, 'b')

This comment has been minimized.

Copy link
@Timost

Timost Sep 8, 2019

Missing a test for the valid case:

Suggested change
def test_ask_parameter_valid(iface):
ask = AskParameter(iface)
assert ask.validate('foobar', 'a') == 'foobar'
test/test_actionsmap.py Outdated Show resolved Hide resolved
test/test_actionsmap.py Outdated Show resolved Hide resolved
test/test_actionsmap.py Show resolved Hide resolved

@decentral1se decentral1se force-pushed the decentral1se:add-actions-map-unit-tests branch from ac2e1dc to cef72f7 Sep 10, 2019

@decentral1se

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2019

I've taken a pass now and resolved comments that I dealt with.

Something that is missing is some test tooling around msignals and m18n to test the call methods of the various classes. Maybe it already exists and I'm not aware of it.

Yes, you're right. I didn't write tests against this as I got tired of it for now.

@Timost

This comment has been minimized.

Copy link

commented Sep 11, 2019

Ok thank you ! LGTM. Writing tests isn't the funniest part indeed.

@Timost
Timost approved these changes Sep 11, 2019
@decentral1se

This comment has been minimized.

Copy link
Member Author

commented Sep 11, 2019

🚀

I'll merge this tomorrow or so if there are no objections.

@decentral1se decentral1se merged commit caf7d28 into YunoHost:stretch-unstable Sep 13, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@decentral1se decentral1se deleted the decentral1se:add-actions-map-unit-tests branch Sep 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.