Use assertIn and assertNotIn for test

because assertIn and assertNotIn raise more meaningful errors

Change-Id: I4b691d3ef271c8e5ecfcae8257b940213756cf07
This commit is contained in:
zhangguoqing 2016-03-16 21:38:22 +08:00
parent 63b1232b5b
commit 63bf149723
2 changed files with 2 additions and 2 deletions

View File

@ -274,7 +274,7 @@ class TestQueryToKwArgs(tests_base.BaseTestCase):
request.headers.return_value = {'X-ProjectId': 'foobar'}
kwargs = utils.query_to_kwargs(queries,
storage.SampleFilter.__init__)
self.assertFalse('self' in kwargs)
self.assertNotIn('self', kwargs)
def test_sample_filter_translation(self):
queries = [v2_base.Query(field=f,

View File

@ -287,7 +287,7 @@ class FakeZaqarClient(object):
def subscription(self, queue_name, **kwargs):
self.client.assertEqual('foobar-critical', queue_name)
subscribers = ['http://example.com/data', 'mailto:foo@example.com']
self.client.assertTrue(kwargs['subscriber'] in subscribers)
self.client.assertIn(kwargs['subscriber'], subscribers)
self.client.assertEqual('7200', kwargs['ttl'])