YouCompleteMe/python/ycm/tests
Homu 1201115141 Auto merge of #1927 - micbou:event-notification-test, r=Valloric
[READY] Fix issue in EventNotification tests

While I was reviewing PR #1905, I found an issue with the `EventNotification` tests. It's easy to reproduce. You just need to comment [this line in `python/ycm/youcompleteme.py`](https://github.com/Valloric/YouCompleteMe/blob/master/python/ycm/youcompleteme.py#L508) and run the tests. With this change, the `EventNotification` tests should fail since the second call of `ValidateParseRequest` re-raises the warning. However, tests are still passing because `assert_has_calls` does not check if a call was not made. For example, if `functionA` is called twice, both `assert_has_calls( [ functionA ] )` and `assert_has_calls( [ functionA, functionA ] )` are successful.

To fix this, we just need to check the number of calls using `call_count`. This is done by creating a subclass of `MagicMock` implementing the `assert_has_exact_calls` method and using it in tests.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1927)
<!-- Reviewable:end -->
2016-01-25 08:26:15 +09:00
..
testdata Now extracting PHP functions. 2014-09-02 10:53:38 -07:00
__init__.py Support subcommands which return detailed info 2015-09-20 21:30:23 +01:00
base_test.py Custom identifier support now done. 2014-08-28 11:39:10 -07:00
event_notification_test.py Fix issue in EventNotification tests 2016-01-21 03:05:15 +01:00
omni_completion_request_tests.py Add missing implementation on OmniCompletionRequest 2016-01-16 11:36:58 -07:00
paths_test.py Fix typo in test 2016-01-12 22:51:15 +01:00
postcomplete_tests.py Add tests for YouCompleteMe.ValidateParseRequest 2015-12-24 21:06:44 +00:00
syntax_parse_test.py Support subcommands which return detailed info 2015-09-20 21:30:23 +01:00
vimsupport_test.py Update buffers-related tests 2015-11-11 14:18:26 +01:00