Description: Use old pyhamcrest API in tests
 Upstream has switched away from the deprecated contains() in
 favour of contains_exactly(), but this is not included yet in
 the version of pyhamcrest packaged in Debian, so this patch switches
 back to the old API to decouple us from the pyhamcrest update.
 .
 The patch was autogenerated by:
   sed -i 's#contains_exactly#contains#g' python/ycm/tests/*.py
Author: David Kalnischkies <donkult@debian.org>
Forwarded: not needed
Last-Update: 2020-10-28

--- a/python/ycm/tests/command_test.py
+++ b/python/ycm/tests/command_test.py
@@ -18,7 +18,7 @@
 from ycm.tests.test_utils import MockVimModule, MockVimBuffers, VimBuffer
 MockVimModule()
 
-from hamcrest import assert_that, contains_exactly, has_entries
+from hamcrest import assert_that, contains, has_entries
 from unittest.mock import patch
 
 from ycm.tests import YouCompleteMeInstance
@@ -33,8 +33,8 @@
       assert_that(
         # Positional arguments passed to SendCommandRequest.
         send_request.call_args[ 0 ],
-        contains_exactly(
-          contains_exactly( 'GoTo' ),
+        contains(
+          contains( 'GoTo' ),
           'aboveleft',
           'same-buffer',
           has_entries( {
@@ -59,8 +59,8 @@
       assert_that(
         # Positional arguments passed to SendCommandRequest.
         send_request.call_args[ 0 ],
-        contains_exactly(
-          contains_exactly( 'GoTo' ),
+        contains(
+          contains( 'GoTo' ),
           'belowright',
           'same-buffer',
           has_entries( {
--- a/python/ycm/tests/completion_test.py
+++ b/python/ycm/tests/completion_test.py
@@ -21,7 +21,7 @@
 
 import contextlib
 from hamcrest import ( assert_that,
-                       contains_exactly,
+                       contains,
                        empty,
                        equal_to,
                        has_entries )
@@ -128,7 +128,7 @@
       assert_that(
         response,
         has_entries( {
-          'completions': contains_exactly( has_entries( {
+          'completions': contains( has_entries( {
             'word': 'insertion_text',
             'abbr': 'menu_text',
             'menu': 'extra_menu_info',
@@ -219,7 +219,7 @@
       assert_that(
         response,
         has_entries( {
-          'completions': contains_exactly( has_entries( {
+          'completions': contains( has_entries( {
             'word': 'insertion_text',
             'abbr': 'menu_text',
             'menu': 'extra_menu_info',
@@ -320,7 +320,7 @@
       assert_that(
         response,
         has_entries( {
-          'completions': contains_exactly( has_entries( {
+          'completions': contains( has_entries( {
             'word': 'insertion_text',
             'abbr': 'menu_text',
             'menu': 'extra_menu_info',
@@ -388,7 +388,7 @@
       assert_that(
         response,
         has_entries( {
-          'completions': contains_exactly( has_entries( {
+          'completions': contains( has_entries( {
             'word': 'insertion_text',
             'abbr': 'menu_text',
             'menu': 'extra_menu_info',
@@ -448,7 +448,7 @@
       assert_that(
         response,
         has_entries( {
-          'completions': contains_exactly( has_entries( {
+          'completions': contains( has_entries( {
             'word': 'insertion_text',
             'abbr': 'menu_text',
             'menu': 'extra_menu_info',
--- a/python/ycm/tests/event_notification_test.py
+++ b/python/ycm/tests/event_notification_test.py
@@ -29,7 +29,7 @@
 from ycmd.responses import ( BuildDiagnosticData, Diagnostic, Location, Range,
                              UnknownExtraConf, ServerError )
 
-from hamcrest import ( assert_that, contains_exactly, empty, equal_to,
+from hamcrest import ( assert_that, contains, empty, equal_to,
                        has_entries, has_entry, has_item, has_items, has_key,
                        is_not )
 from unittest.mock import call, MagicMock, patch
@@ -279,7 +279,7 @@
       ycm.HandleFileParseRequest()
       assert_that(
         test_utils.VIM_SIGNS,
-        contains_exactly(
+        contains(
           VimSign( SIGN_BUFFER_ID_INITIAL_VALUE, 1, 'YcmError', 1 )
         )
       )
@@ -291,7 +291,7 @@
       ycm.HandleFileParseRequest()
       assert_that(
         test_utils.VIM_SIGNS,
-        contains_exactly(
+        contains(
           VimSign( SIGN_BUFFER_ID_INITIAL_VALUE, 1, 'YcmError', 1 )
         )
       )
@@ -306,7 +306,7 @@
       ycm.HandleFileParseRequest()
       assert_that(
         test_utils.VIM_SIGNS,
-        contains_exactly(
+        contains(
           VimSign( SIGN_BUFFER_ID_INITIAL_VALUE, 1, 'YcmError', 1 )
         )
       )
@@ -334,7 +334,7 @@
       ycm.HandleFileParseRequest()
       assert_that(
         test_utils.VIM_SIGNS,
-        contains_exactly(
+        contains(
           VimSign( SIGN_BUFFER_ID_INITIAL_VALUE + 2, 2, 'YcmWarning', 1 )
         )
       )
@@ -346,7 +346,7 @@
       ycm.HandleFileParseRequest()
       assert_that(
         test_utils.VIM_SIGNS,
-        contains_exactly(
+        contains(
           VimSign( SIGN_BUFFER_ID_INITIAL_VALUE + 2, 2, 'YcmWarning', 1 )
         )
       )
@@ -392,7 +392,7 @@
     assert_that(
       # Positional arguments passed to PostDataToHandlerAsync.
       post_data_to_handler_async.call_args[ 0 ],
-      contains_exactly(
+      contains(
         has_entries( {
           'filepath': current_buffer_file,
           'line_num': 1,
@@ -446,7 +446,7 @@
     assert_that(
       # Positional arguments passed to PostDataToHandlerAsync.
       post_data_to_handler_async.call_args[ 0 ],
-      contains_exactly(
+      contains(
         has_entries( {
           'filepath': current_buffer_file,
           'line_num': 1,
@@ -494,7 +494,7 @@
   assert_that(
     # Positional arguments passed to PostDataToHandlerAsync.
     post_data_to_handler_async.call_args[ 0 ],
-    contains_exactly(
+    contains(
       has_entries( {
         'filepath': deleted_buffer_file,
         'line_num': 1,
@@ -533,7 +533,7 @@
       assert_that(
         # Positional arguments passed to PostDataToHandlerAsync.
         post_data_to_handler_async.call_args[ 0 ],
-        contains_exactly(
+        contains(
           has_entry( 'syntax_keywords', has_items( 'foo', 'bar' ) ),
           'event_notification'
         )
@@ -544,7 +544,7 @@
       assert_that(
         # Positional arguments passed to PostDataToHandlerAsync.
         post_data_to_handler_async.call_args[ 0 ],
-        contains_exactly(
+        contains(
           is_not( has_key( 'syntax_keywords' ) ),
           'event_notification'
         )
@@ -568,7 +568,7 @@
       assert_that(
         # Positional arguments passed to PostDataToHandlerAsync.
         post_data_to_handler_async.call_args[ 0 ],
-        contains_exactly(
+        contains(
           has_entry( 'syntax_keywords', has_items( 'foo', 'bar' ) ),
           'event_notification'
         )
@@ -581,7 +581,7 @@
       assert_that(
         # Positional arguments passed to PostDataToHandlerAsync.
         post_data_to_handler_async.call_args[ 0 ],
-        contains_exactly(
+        contains(
           has_entry( 'syntax_keywords', has_items( 'foo', 'bar' ) ),
           'event_notification'
         )
--- a/python/ycm/tests/omni_completer_test.py
+++ b/python/ycm/tests/omni_completer_test.py
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.
 
-from hamcrest import assert_that, contains_exactly, empty, has_entries
+from hamcrest import assert_that, contains, empty, has_entries
 import pytest
 
 from ycm.tests.test_utils import MockVimBuffers, MockVimModule, VimBuffer
@@ -255,7 +255,7 @@
     assert_that(
       ycm.GetCompletionResponse(),
       has_entries( {
-        'completions': contains_exactly( {
+        'completions': contains( {
           'word' : 'test',
           'abbr' : 'ABBRTEST',
           'menu' : 'MENUTEST',
@@ -616,7 +616,7 @@
     assert_that(
       ycm.GetCompletionResponse(),
       has_entries( {
-        'completions': contains_exactly( {
+        'completions': contains( {
           'word' : 'test',
           'abbr' : 'ÅııÂÊ‰ÍÊ',
           'menu' : '˜‰ˆËÊ‰ÍÊ',
@@ -660,7 +660,7 @@
     ycm.SendCompletionRequest()
     assert_that(
       vimsupport.CurrentLineAndColumn(),
-      contains_exactly( 2, 5 )
+      contains( 2, 5 )
     )
     assert_that(
       ycm.GetCompletionResponse(),
@@ -695,7 +695,7 @@
     ycm.SendCompletionRequest()
     assert_that(
       vimsupport.CurrentLineAndColumn(),
-      contains_exactly( 2, 7 )
+      contains( 2, 7 )
     )
     assert_that(
       ycm.GetCompletionResponse(),
--- a/python/ycm/tests/postcomplete_test.py
+++ b/python/ycm/tests/postcomplete_test.py
@@ -22,7 +22,7 @@
 
 import contextlib
 import json
-from hamcrest import assert_that, contains_exactly, empty, equal_to, none
+from hamcrest import assert_that, contains, empty, equal_to, none
 from unittest.mock import MagicMock, DEFAULT, patch
 
 from ycm import vimsupport
@@ -175,7 +175,7 @@
 def FilterToCompletedCompletions_MatchIsReturned_test():
   completions = [ BuildCompletion( insertion_text = 'Test' ) ]
   result = _FilterToMatchingCompletions( CompleteItemIs( 'Test' ), completions )
-  assert_that( list( result ), contains_exactly( {} ) )
+  assert_that( list( result ), contains( {} ) )
 
 
 def FilterToCompletedCompletions_ShortTextDoesntRaise_test():
@@ -187,7 +187,7 @@
 def FilterToCompletedCompletions_ExactMatchIsReturned_test():
   completions = [ BuildCompletion( insertion_text = 'Test' ) ]
   result = _FilterToMatchingCompletions( CompleteItemIs( 'Test' ), completions )
-  assert_that( list( result ), contains_exactly( {} ) )
+  assert_that( list( result ), contains( {} ) )
 
 
 def FilterToCompletedCompletions_NonMatchIsntReturned_test():
@@ -201,7 +201,7 @@
   completions = [ BuildCompletion( insertion_text = '†es†' ) ]
   result = _FilterToMatchingCompletions( CompleteItemIs( '†es†' ),
                                          completions )
-  assert_that( list( result ), contains_exactly( {} ) )
+  assert_that( list( result ), contains( {} ) )
 
 
 def GetRequiredNamespaceImport_ReturnNoneForNoExtraData_test():
@@ -231,7 +231,7 @@
     with patch( 'ycm.vimsupport.GetVariableValue',
                 GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
       assert_that( request._GetExtraDataUserMayHaveCompleted(),
-                   contains_exactly( completions[ 0 ][ 'extra_data' ] ) )
+                   contains( completions[ 0 ][ 'extra_data' ] ) )
 
 
 def GetExtraDataUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial_test(): # noqa
@@ -242,7 +242,7 @@
     with patch( 'ycm.vimsupport.GetVariableValue',
                 GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
       assert_that( request._GetExtraDataUserMayHaveCompleted(),
-                   contains_exactly( completions[ 0 ][ 'extra_data' ] ) )
+                   contains( completions[ 0 ][ 'extra_data' ] ) )
 
 
 def GetExtraDataUserMayHaveCompleted_DontReturnMatchIfNoExactMatchesAndPartial_test(): # noqa
@@ -261,7 +261,7 @@
   completions = [ BuildCompletionNamespace( None ) ]
   with _SetupForCsharpCompletionDone( completions ) as request:
     assert_that( request._GetExtraDataUserMayHaveCompleted(),
-                 contains_exactly( completions[ 0 ][ 'extra_data' ] ) )
+                 contains( completions[ 0 ][ 'extra_data' ] ) )
 
 
 @patch( 'ycm.vimsupport.GetVariableValue',
@@ -278,7 +278,7 @@
 
   with _SetupForCsharpCompletionDone( completions ) as request:
     assert_that( request._GetExtraDataUserMayHaveCompleted(),
-                 contains_exactly(
+                 contains(
                    BuildCompletionNamespace( 'namespace1' )[ 'extra_data' ] ) )
 
 
@@ -296,7 +296,7 @@
 
   with _SetupForCsharpCompletionDone( completions ) as request:
     assert_that( request._GetExtraDataUserMayHaveCompleted(),
-                 contains_exactly(
+                 contains(
                    BuildCompletionNamespace( 'namespace2' )[ 'extra_data' ] ) )
 
 
--- a/python/ycm/tests/vimsupport_test.py
+++ b/python/ycm/tests/vimsupport_test.py
@@ -21,7 +21,7 @@
 MockVimModule()
 
 from ycm import vimsupport
-from hamcrest import ( assert_that, calling, contains_exactly, empty, equal_to,
+from hamcrest import ( assert_that, calling, contains, empty, equal_to,
                        has_entry, is_not, raises )
 from unittest.mock import MagicMock, call, patch
 from ycmd.utils import ToBytes
@@ -621,7 +621,7 @@
 
   AssertBuffersAreEqualAsBytes( [ 'xyz', 'foobar' ], result_buffer )
   # Cursor line is 0-based.
-  assert_that( vimsupport.CurrentLineAndColumn(), contains_exactly( 1, 6 ) )
+  assert_that( vimsupport.CurrentLineAndColumn(), contains( 1, 6 ) )
 
 
 def _BuildLocations( start_line, start_column, end_line, end_column ):
@@ -772,7 +772,7 @@
     vimsupport.ReplaceChunks( chunks )
 
   # Ensure that we applied the replacement correctly
-  assert_that( result_buffer.GetLines(), contains_exactly(
+  assert_that( result_buffer.GetLines(), contains(
     'replacementline2',
     'line3',
   ) )
@@ -865,7 +865,7 @@
   ] )
 
   # Ensure that we applied the replacement correctly
-  assert_that( result_buffer.GetLines(), contains_exactly(
+  assert_that( result_buffer.GetLines(), contains(
     'replacementline2',
     'line3',
   ) )
@@ -978,7 +978,7 @@
   confirm.assert_not_called()
 
   # Ensure that we applied the replacement correctly
-  assert_that( result_buffer.GetLines(), contains_exactly(
+  assert_that( result_buffer.GetLines(), contains(
     'replacementline2',
     'line3',
   ) )
@@ -1075,7 +1075,7 @@
   ] )
 
   # Ensure that buffer is not changed
-  assert_that( result_buffer.GetLines(), contains_exactly(
+  assert_that( result_buffer.GetLines(), contains(
     'line1',
     'line2',
     'line3',
@@ -1162,7 +1162,7 @@
   ] )
 
   # Ensure that buffer is not changed
-  assert_that( result_buffer.GetLines(), contains_exactly(
+  assert_that( result_buffer.GetLines(), contains(
     'line1',
     'line2',
     'line3',
@@ -1268,11 +1268,11 @@
   ] )
 
   # Ensure that buffers are updated
-  assert_that( second_file.GetLines(), contains_exactly(
+  assert_that( second_file.GetLines(), contains(
     'another line1',
     'second_file_replacement ACME line2',
   ) )
-  assert_that( first_file.GetLines(), contains_exactly(
+  assert_that( first_file.GetLines(), contains(
     'first_file_replacement line2',
     'line3',
   ) )
@@ -1662,10 +1662,10 @@
 def Filetypes_IntegerFiletype_test():
   current_buffer = VimBuffer( 'buffer', number = 1, filetype = '42' )
   with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):
-    assert_that( vimsupport.CurrentFiletypes(), contains_exactly( '42' ) )
-    assert_that( vimsupport.GetBufferFiletypes( 1 ), contains_exactly( '42' ) )
+    assert_that( vimsupport.CurrentFiletypes(), contains( '42' ) )
+    assert_that( vimsupport.GetBufferFiletypes( 1 ), contains( '42' ) )
     assert_that( vimsupport.FiletypesForBuffer( current_buffer ),
-                 contains_exactly( '42' ) )
+                 contains( '42' ) )
 
 
 @patch( 'ycm.vimsupport.VariableExists', return_value = False )
--- a/python/ycm/tests/youcompleteme_test.py
+++ b/python/ycm/tests/youcompleteme_test.py
@@ -27,7 +27,7 @@
 
 import os
 import sys
-from hamcrest import ( assert_that, contains_exactly, empty, equal_to,
+from hamcrest import ( assert_that, contains, empty, equal_to,
                        has_entries, is_in, is_not, matches_regexp )
 from unittest.mock import call, MagicMock, patch
 
@@ -278,7 +278,7 @@
                 return_value = [ 'SomeCommand', 'AnotherCommand' ] ):
       assert_that(
         ycm.GetDefinedSubcommands(),
-        contains_exactly(
+        contains(
           'SomeCommand',
           'AnotherCommand'
         )
@@ -558,7 +558,7 @@
     assert_that(
       test_utils.VIM_MATCHES_FOR_WINDOW,
       has_entries( {
-        1: contains_exactly(
+        1: contains(
           VimMatch( 'YcmWarningSection', '\\%3l\\%5c\\_.\\{-}\\%3l\\%7c' ),
           VimMatch( 'YcmWarningSection', '\\%3l\\%3c\\_.\\{-}\\%3l\\%9c' ),
           VimMatch( 'YcmErrorSection', '\\%3l\\%8c' )
@@ -569,7 +569,7 @@
     # Only the error sign is placed.
     assert_that(
       test_utils.VIM_SIGNS,
-      contains_exactly(
+      contains(
         VimSign( SIGN_BUFFER_ID_INITIAL_VALUE, 3, 'YcmError', 5 )
       )
     )
@@ -602,7 +602,7 @@
     assert_that(
       test_utils.VIM_MATCHES_FOR_WINDOW,
       has_entries( {
-        1: contains_exactly(
+        1: contains(
           VimMatch( 'YcmWarningSection', '\\%3l\\%5c\\_.\\{-}\\%3l\\%7c' ),
           VimMatch( 'YcmWarningSection', '\\%3l\\%3c\\_.\\{-}\\%3l\\%9c' )
         )
@@ -611,7 +611,7 @@
 
     assert_that(
       test_utils.VIM_SIGNS,
-      contains_exactly(
+      contains(
         VimSign( SIGN_BUFFER_ID_INITIAL_VALUE + 1, 3, 'YcmWarning', 5 )
       )
     )
@@ -878,7 +878,7 @@
   assert_that(
     test_utils.VIM_MATCHES_FOR_WINDOW,
     has_entries( {
-      1: contains_exactly(
+      1: contains(
         VimMatch( 'YcmErrorSection', '\\%1l\\%1c\\_.\\{-}\\%1l\\%1c' )
       )
     } )
@@ -1065,7 +1065,7 @@
   assert_that(
     test_utils.VIM_MATCHES_FOR_WINDOW,
     has_entries( {
-      1: contains_exactly(
+      1: contains(
         VimMatch( 'YcmErrorSection', '\\%1l\\%1c\\_.\\{-}\\%1l\\%1c' )
       )
     } )
