1201115141
[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 --> |
||
---|---|---|
.. | ||
client | ||
tests | ||
__init__.py | ||
base.py | ||
diagnostic_interface.py | ||
omni_completer.py | ||
paths.py | ||
syntax_parse.py | ||
test_utils.py | ||
unsafe_thread_pool_executor.py | ||
vimsupport.py | ||
youcompleteme.py |