161
161
self.assertEqual(len(wrapped.subchecks), 2)
162
162
self.assertThat(wrapped.subchecks[0],
163
163
FunctionCheckMatcher('tcp.localhost:8080', 'localhost:8080'))
164
self.assertThat(wrapped.subchecks[1], FunctionCheckMatcher('auth', None))
164
self.assertThat(wrapped.subchecks[1], FunctionCheckMatcher('connect', None))
166
def test_make_redis_check_with_password(self):
167
result = conn_check.make_redis_check('localhost', 8080, 'foobar')
168
self.assertIsInstance(result, conn_check.PrefixCheckWrapper)
169
self.assertEqual(result.prefix, 'redis.')
170
wrapped = result.wrapped
171
self.assertIsInstance(wrapped, conn_check.MultiCheck)
172
self.assertIs(wrapped.strategy, conn_check.sequential_strategy)
173
self.assertEqual(len(wrapped.subchecks), 2)
174
self.assertThat(wrapped.subchecks[0],
175
FunctionCheckMatcher('tcp.localhost:8080', 'localhost:8080'))
176
self.assertThat(wrapped.subchecks[1],
177
FunctionCheckMatcher('connect with auth', None))
167
179
def test_check_from_description_unknown_type(self):
168
180
e = self.assertRaises(AssertionError,