Beispiel #1
0
 def test_good_connection_string(self):
     result = _tcp_to_amqp('tcp://10.1.1.255:5000')
     self.assertEqual(result, 'amqp://10.1.1.255:5000//')
Beispiel #2
0
 def test_password_only(self):
     with self.assertRaisesRegexp(daedalus.exceptions.MissingFields, 'Need both username and password'):
         _tcp_to_amqp('tcp://10.1.1.1:5000', password='******')
Beispiel #3
0
 def test_username_and_password(self):
     result = _tcp_to_amqp('tcp://10.1.1.255:5000', username='******', password='******')
     self.assertEqual(result, 'amqp://*****:*****@10.1.1.255:5000//')
Beispiel #4
0
 def test_empty_connection_string(self):
     with self.assertRaisesRegexp(daedalus.exceptions.BadConnectionString, 'Not a valid TCP connection string: '):
         _tcp_to_amqp('')
Beispiel #5
0
 def test_no_connection_string(self):
     with self.assertRaisesRegexp(TypeError, 'expected string or buffer'):
         _tcp_to_amqp(None)
Beispiel #6
0
 def test_bad_connection_string(self):
     with self.assertRaisesRegexp(daedalus.exceptions.BadConnectionString, 'Not a valid TCP connection string: this is a bad string'):
         _tcp_to_amqp('this is a bad string')