Esempio n. 1
0
 def test_exists_with_option_and_no_empty_return(self, lst_method):
     """Check exists method with options and no empty return"""
     lst_method.return_value = [1, 2]
     my_options = {'search': 'foo=bar'}
     response = Base.exists(my_options, search=['id', 1])
     lst_method.assert_called_once_with(my_options)
     assert 1 == response
Esempio n. 2
0
 def test_exists_with_option_and_no_empty_return(self, lst_method):
     """Check exists method with options and no empty return"""
     lst_method.return_value = [1, 2]
     my_options = {u'search': u'foo=bar'}
     response = Base.exists(my_options, search=['id', 1])
     lst_method.assert_called_once_with(my_options)
     self.assertEqual(1, response)
Esempio n. 3
0
 def test_exists_without_option_and_empty_return(self, lst_method):
     """Check exists method without options and empty return"""
     lst_method.return_value = []
     response = Base.exists(search=['id', 1])
     lst_method.assert_called_once_with({'search': 'id=\\"1\\"'})
     assert [] == response
Esempio n. 4
0
 def test_exists_without_option_and_empty_return(self, lst_method):
     """Check exists method without options and empty return"""
     lst_method.return_value = []
     response = Base.exists(search=['id', 1])
     lst_method.assert_called_once_with({u'search': u'id=\\"1\\"'})
     self.assertEqual([], response)