Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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)
Ejemplo n.º 4
0
 def preferred_port(self):
     return Defaults.get_port(self.options)
Ejemplo n.º 5
0
 def preferred_port(self):
     return Defaults.get_port(self.options)
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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"
Ejemplo n.º 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"
Ejemplo n.º 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
Ejemplo n.º 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"
Ejemplo n.º 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"
Ejemplo n.º 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