Пример #1
0
 def test_tls_defaults_to_true(self):
     ably = AblyRest(token='foo')
     self.assertTrue(ably.options.tls,
                     msg="Expected encryption to default to true")
     self.assertEqual(Defaults.tls_port,
                      Defaults.get_port(ably.options),
                      msg="Unexpected port mismatch")
Пример #2
0
 def test_tls_can_be_disabled(self):
     ably = AblyRest(token='foo', tls=False)
     self.assertFalse(ably.options.tls,
                      msg="Expected encryption to be False")
     self.assertEqual(Defaults.port,
                      Defaults.get_port(ably.options),
                      msg="Unexpected port mismatch")
Пример #3
0
 def test_specified_tls_port(self):
     ably = AblyRest(token='foo', tls_port=9999, tls=True)
     self.assertEqual(
         9999,
         Defaults.get_port(ably.options),
         msg="Unexpected port mismatch. Expected: 9999. Actual: %d" %
         ably.options.tls_port)
Пример #4
0
 def preferred_port(self):
     return Defaults.get_port(self.options)
Пример #5
0
 def preferred_port(self):
     return Defaults.get_port(self.options)
Пример #6
0
 def test_tls_can_be_disabled(self):
     ably = AblyRest(Options(tls=False))
     self.assertFalse(ably.options.tls,
             msg="Expected encryption to be False")
     self.assertEqual(Defaults.port, Defaults.get_port(ably.options),
             msg="Unexpected port mismatch")
Пример #7
0
 def test_tls_defaults_to_true(self):
     ably = AblyRest()
     self.assertTrue(ably.options.tls,
             msg="Expected encryption to default to true")
     self.assertEqual(Defaults.tls_port, Defaults.get_port(ably.options),
             msg="Unexpected port mismatch")
Пример #8
0
 def test_specified_port(self):
     ably = AblyRest(Options(port=9998, tls_port=9999))
     self.assertEqual(9999, Defaults.get_port(ably.options),
             msg="Unexpected port mismatch. Expected: 9999. Actual: %d" % ably.options.tls_port)
Пример #9
0
 def test_specified_non_tls_port(self):
     ably = AblyRest(token='foo', port=9998, tls=False)
     self.assertEqual(9998, Defaults.get_port(ably.options),
                      msg="Unexpected port mismatch. Expected: 9999. Actual: %d" %
                      ably.options.tls_port)
Пример #10
0
 def test_tls_can_be_disabled(self):
     ably = AblyRest(token='foo', tls=False)
     assert not ably.options.tls, "Expected encryption to be False"
     assert Defaults.port == Defaults.get_port(ably.options), "Unexpected port mismatch"
Пример #11
0
 def test_tls_defaults_to_true(self):
     ably = AblyRest(token='foo')
     assert ably.options.tls, "Expected encryption to default to true"
     assert Defaults.tls_port == Defaults.get_port(ably.options), "Unexpected port mismatch"
Пример #12
0
 def test_specified_tls_port(self):
     ably = AblyRest(token='foo', tls_port=9999, tls=True)
     assert 9999 == Defaults.get_port(ably.options), "Unexpected port mismatch. Expected: 9999. Actual: %d" % ably.options.tls_port
Пример #13
0
 def test_tls_can_be_disabled(self):
     ably = AblyRest(token='foo', tls=False)
     assert not ably.options.tls, "Expected encryption to be False"
     assert Defaults.port == Defaults.get_port(
         ably.options), "Unexpected port mismatch"
Пример #14
0
 def test_tls_defaults_to_true(self):
     ably = AblyRest(token='foo')
     assert ably.options.tls, "Expected encryption to default to true"
     assert Defaults.tls_port == Defaults.get_port(
         ably.options), "Unexpected port mismatch"
Пример #15
0
 def test_specified_non_tls_port(self):
     ably = AblyRest(token='foo', port=9998, tls=False)
     assert 9998 == Defaults.get_port(
         ably.options
     ), "Unexpected port mismatch. Expected: 9999. Actual: %d" % ably.options.tls_port