예제 #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