~ubuntuone-hackers/conn-check/trunk

« back to all changes in this revision

Viewing changes to tests.py

  • Committer: James Westby
  • Date: 2014-07-24 19:30:30 UTC
  • mfrom: (13 conn-check)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@canonical.com-20140724193030-7dmxpb0rlb7bhztk
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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))
165
165
 
 
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))
166
178
 
167
179
    def test_check_from_description_unknown_type(self):
168
180
        e = self.assertRaises(AssertionError,