YouCompleteMe/python/ycm
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
..
client Add missing implementation on OmniCompletionRequest 2016-01-16 11:36:58 -07:00
tests Auto merge of #1927 - micbou:event-notification-test, r=Valloric 2016-01-25 08:26:15 +09:00
__init__.py Fixing python tests broken in rename 2013-05-19 20:06:14 -07:00
base.py Deleting obsolete code 2015-07-02 08:38:27 -07:00
diagnostic_interface.py Document YcmGetErrorCount and YcmGetWarningCount functions 2015-12-05 09:12:28 -08:00
omni_completer.py Refactored completion request creation 2014-05-27 17:38:34 -07:00
paths.py Fall back to Python search in PATH 2016-01-23 16:59:13 +01:00
syntax_parse.py Now extracting PHP functions. 2014-09-02 10:53:38 -07:00
test_utils.py Fix issue in EventNotification tests 2016-01-21 03:05:15 +01:00
unsafe_thread_pool_executor.py Changing copyright headers from me to Google 2014-01-13 11:08:43 -08:00
vimsupport.py Fix GoTo lists arriving at the wrong column. 2016-01-04 23:04:13 +00:00
youcompleteme.py fixup! Don't cache invalid completer check results 2016-01-12 15:15:29 -07:00