qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [05/50] [abbrv] qpid-proton git commit: PROTON-982: Make proton python tests compatible with unittest
Date Mon, 28 Sep 2015 18:09:31 GMT
PROTON-982: Make proton python tests compatible with unittest


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/b430410b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/b430410b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/b430410b

Branch: refs/heads/proton-go
Commit: b430410b760e557ab00ff5d482974b3cdc2d33a0
Parents: 8c9ca3d
Author: Bozo Dragojevic <bozzo@digiverse.si>
Authored: Mon Sep 14 11:43:47 2015 +0200
Committer: Bozo Dragojevic <bozzo@digiverse.si>
Committed: Wed Sep 16 15:40:05 2015 +0200

----------------------------------------------------------------------
 proton-c/bindings/python/tox.ini             |  2 +
 proton-j/src/main/resources/cerror.py        |  3 +-
 tests/python/proton-test                     | 14 +++----
 tests/python/proton_tests/codec.py           |  4 +-
 tests/python/proton_tests/common.py          | 10 ++++-
 tests/python/proton_tests/engine.py          | 48 +++++++++++------------
 tests/python/proton_tests/interop.py         |  4 +-
 tests/python/proton_tests/message.py         |  4 +-
 tests/python/proton_tests/messenger.py       | 12 +++---
 tests/python/proton_tests/reactor.py         |  2 +-
 tests/python/proton_tests/reactor_interop.py |  2 +-
 tests/python/proton_tests/sasl.py            | 10 ++---
 tests/python/proton_tests/soak.py            |  4 +-
 tests/python/proton_tests/ssl.py             | 46 +++++++++++-----------
 tests/python/proton_tests/transport.py       |  8 ++--
 15 files changed, 91 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/proton-c/bindings/python/tox.ini
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/tox.ini b/proton-c/bindings/python/tox.ini
index 0a044e5..4501460 100644
--- a/proton-c/bindings/python/tox.ini
+++ b/proton-c/bindings/python/tox.ini
@@ -18,6 +18,8 @@ passenv =
     CLASSPATH
 commands =
     {toxinidir}/../../../tests/python/proton-test {posargs}
+deps =
+    unittest2
 
 [testenv:pep8]
 commands = flake8

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/proton-j/src/main/resources/cerror.py
----------------------------------------------------------------------
diff --git a/proton-j/src/main/resources/cerror.py b/proton-j/src/main/resources/cerror.py
index 4256fc4..c87681c 100644
--- a/proton-j/src/main/resources/cerror.py
+++ b/proton-j/src/main/resources/cerror.py
@@ -45,5 +45,4 @@ def pn_error_code(err):
 def pn_error_text(err):
   return err.text
 
-class Skipped(Exception):
-  skipped = True
+from unittest import SkipTest as Skipped

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton-test
----------------------------------------------------------------------
diff --git a/tests/python/proton-test b/tests/python/proton-test
index 12ccb11..88817ef 100755
--- a/tests/python/proton-test
+++ b/tests/python/proton-test
@@ -25,6 +25,11 @@ from fnmatch import fnmatchcase as match
 from getopt import GetoptError
 from logging import getLogger, StreamHandler, Formatter, Filter, \
     WARN, DEBUG, ERROR
+import unittest
+try:
+  from unittest import SkipTest
+except:
+  from unittest2 import SkipTest
 
 if sys.version_info[0] == 3:
     CLASS_TYPES = (type,)
@@ -347,7 +352,7 @@ class Runner:
     return self.exception or self.skip
 
   def run(self, phase_name, phase):
-    """invokes a test-phase method (which can be the test method itself or a setup/teardown
+    """invokes a test-phase method (which can be the test method itself or a setUp/tearDown
        method).  If the method raises an exception the exception is examined to see if the
        exception should be classified as a 'skipped' test"""
     # we don't try to catch exceptions for jython because currently a
@@ -364,7 +369,7 @@ class Runner:
         self.exception_phase_name = phase_name
         self.exception = sys.exc_info()
         exception_type = self.exception[0]
-        self.skip = getattr(exception_type, "skipped", False)
+        self.skip = getattr(exception_type, "skipped", False) or issubclass(exception_type,
SkipTest)
 
   def status(self):
     if self.passed():
@@ -517,14 +522,9 @@ class MethodTest:
     if hasattr(inst, "setUp"):
       runner.run("setup", inst.setUp)
       if runner.halt(): return runner
-    if hasattr(inst, "setup"):
-      runner.run("setup", inst.setup)
-      if runner.halt(): return runner
 
     runner.run("test", test)
 
-    if hasattr(inst, "teardown"):
-      runner.run("teardown", inst.teardown)
     if hasattr(inst, "tearDown"):
       runner.run("teardown", inst.tearDown)
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/codec.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/codec.py b/tests/python/proton_tests/codec.py
index d924027..19792df 100644
--- a/tests/python/proton_tests/codec.py
+++ b/tests/python/proton_tests/codec.py
@@ -28,10 +28,10 @@ except ImportError:
 
 class Test(common.Test):
 
-  def setup(self):
+  def setUp(self):
     self.data = Data()
 
-  def teardown(self):
+  def tearDown(self):
     self.data = None
 
 class DataTest(Test):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/common.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/common.py b/tests/python/proton_tests/common.py
index dab6fba..c819d4e 100644
--- a/tests/python/proton_tests/common.py
+++ b/tests/python/proton_tests/common.py
@@ -18,6 +18,10 @@
 #
 
 from unittest import TestCase
+try:
+  from unittest import SkipTest
+except:
+  from unittest2 import SkipTest
 from random import randint
 from threading import Thread
 from socket import socket, AF_INET, SOCK_STREAM
@@ -147,7 +151,11 @@ def ensureCanTestExtendedSASL():
   if not createdSASLDb:
     raise Skipped("Can't Test Extended SASL: Couldn't create auth db")
 
+class DefaultConfig:
+    defines = {}
+    
 class Test(TestCase):
+  config = DefaultConfig()
 
   def __init__(self, name):
     super(Test, self).__init__(name)
@@ -176,7 +184,7 @@ class Test(TestCase):
     return int(self.default("verbose", 0))
 
 
-class Skipped(Exception):
+class Skipped(SkipTest):
   skipped = True
 
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py b/tests/python/proton_tests/engine.py
index 7446288..7946d2c 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -113,7 +113,7 @@ class Test(common.Test):
 
 class ConnectionTest(Test):
 
-  def setup(self):
+  def setUp(self):
     gc.enable()
     self.c1, self.c2 = self.connection()
 
@@ -123,7 +123,7 @@ class ConnectionTest(Test):
     self.c1 = None
     self.c2 = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
     gc.collect()
     assert not gc.garbage
@@ -328,7 +328,7 @@ class ConnectionTest(Test):
 
 class SessionTest(Test):
 
-  def setup(self):
+  def setUp(self):
     gc.enable()
     self.c1, self.c2 = self.connection()
     self.ssn = self.c1.session()
@@ -342,7 +342,7 @@ class SessionTest(Test):
     self.c2 = None
     self.ssn = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
     gc.collect()
     assert not gc.garbage
@@ -515,7 +515,7 @@ class SessionTest(Test):
 
 class LinkTest(Test):
 
-  def setup(self):
+  def setUp(self):
     gc.enable()
     self.snd, self.rcv = self.link("test-link")
 
@@ -525,7 +525,7 @@ class LinkTest(Test):
     self.snd = None
     self.rcv = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
     gc.collect()
     assert not gc.garbage, gc.garbage
@@ -799,7 +799,7 @@ class TerminusConfig:
 
 class TransferTest(Test):
 
-  def setup(self):
+  def setUp(self):
     gc.enable()
     self.snd, self.rcv = self.link("test-link")
     self.c1 = self.snd.session.connection
@@ -816,7 +816,7 @@ class TransferTest(Test):
     self.snd = None
     self.rcv = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
     gc.collect()
     assert not gc.garbage
@@ -1005,7 +1005,7 @@ class TransferTest(Test):
 
 class MaxFrameTransferTest(Test):
 
-  def setup(self):
+  def setUp(self):
     pass
 
   def cleanup(self):
@@ -1016,7 +1016,7 @@ class MaxFrameTransferTest(Test):
     self.snd = None
     self.rcv = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def message(self, size):
@@ -1130,7 +1130,7 @@ class MaxFrameTransferTest(Test):
 
 class IdleTimeoutTest(Test):
 
-  def setup(self):
+  def setUp(self):
     pass
 
   def cleanup(self):
@@ -1141,7 +1141,7 @@ class IdleTimeoutTest(Test):
     self.c1 = None
     self.c2 = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def message(self, size):
@@ -1232,7 +1232,7 @@ class IdleTimeoutTest(Test):
 
 class CreditTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.snd, self.rcv = self.link("test-link", max_frame=(16*1024, 16*1024))
     self.c1 = self.snd.session.connection
     self.c2 = self.rcv.session.connection
@@ -1249,7 +1249,7 @@ class CreditTest(Test):
     self.rcv2 = None
     self.snd2 = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def testCreditSender(self, count=1024):
@@ -1642,7 +1642,7 @@ class CreditTest(Test):
 
 class SessionCreditTest(Test):
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def testBuffering(self, count=32, size=1024, capacity=16*1024, max_frame=1024):
@@ -1756,7 +1756,7 @@ class SessionCreditTest(Test):
 
 class SettlementTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.snd, self.rcv = self.link("test-link")
     self.c1 = self.snd.session.connection
     self.c2 = self.rcv.session.connection
@@ -1773,7 +1773,7 @@ class SettlementTest(Test):
     self.rcv2 = None
     self.snd2 = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def testSettleCurrent(self):
@@ -1881,7 +1881,7 @@ class SettlementTest(Test):
 
 class PipelineTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.c1, self.c2 = self.connection()
 
   def cleanup(self):
@@ -1890,7 +1890,7 @@ class PipelineTest(Test):
     self.c1 = None
     self.c2 = None
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def test(self):
@@ -2116,7 +2116,7 @@ class CustomValue:
 
 class DeliveryTest(Test):
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def testDisposition(self, count=1, tag="tag%i", type=Delivery.ACCEPTED, value=NoValue()):
@@ -2188,7 +2188,7 @@ class DeliveryTest(Test):
 
 class CollectorTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.collector = Collector()
 
   def drain(self):
@@ -2227,7 +2227,7 @@ class CollectorTest(Test):
 
 class EventTest(CollectorTest):
 
-  def teardown(self):
+  def tearDown(self):
     self.cleanup()
 
   def testEndpointEvents(self):
@@ -2441,8 +2441,8 @@ class EventTest(CollectorTest):
 
 class PeerTest(CollectorTest):
 
-  def setup(self):
-    CollectorTest.setup(self)
+  def setUp(self):
+    CollectorTest.setUp(self)
     self.connection = Connection()
     self.connection.collect(self.collector)
     self.transport = Transport()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/interop.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/interop.py b/tests/python/proton_tests/interop.py
index 4eedf3c..bb86535 100644
--- a/tests/python/proton_tests/interop.py
+++ b/tests/python/proton_tests/interop.py
@@ -36,11 +36,11 @@ test_interop_dir=find_test_interop_dir()
 
 class InteropTest(common.Test):
 
-    def setup(self):
+    def setUp(self):
         self.data = Data()
         self.message = Message()
 
-    def teardown(self):
+    def tearDown(self):
         self.data = None
 
     def get_data(self, name):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/message.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/message.py b/tests/python/proton_tests/message.py
index 2f7cb4f..7aa9fac 100644
--- a/tests/python/proton_tests/message.py
+++ b/tests/python/proton_tests/message.py
@@ -28,10 +28,10 @@ except ImportError:
 
 class Test(common.Test):
 
-  def setup(self):
+  def setUp(self):
     self.msg = Message()
 
-  def teardown(self):
+  def tearDown(self):
     self.msg = None
 
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/messenger.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/messenger.py b/tests/python/proton_tests/messenger.py
index a69fdb8..b6c3d1f 100644
--- a/tests/python/proton_tests/messenger.py
+++ b/tests/python/proton_tests/messenger.py
@@ -27,14 +27,14 @@ from .common import Skipped
 
 class Test(common.Test):
 
-  def setup(self):
+  def setUp(self):
     self.server_credit = 10
     self.server_received = 0
     self.server_finite_credit = False
     self.server = Messenger("server")
     self.server.timeout = self.timeout
     self.server.start()
-    self.server.subscribe("amqp://~0.0.0.0:12345")
+    self.server.subscribe("amqp://~127.0.0.1:12345")
     self.server_thread = Thread(name="server-thread", target=self.run_server)
     self.server_thread.daemon = True
     self.server_is_running_event = Event()
@@ -55,7 +55,7 @@ class Test(common.Test):
     self.client.stop()
     self.client = None
 
-  def teardown(self):
+  def tearDown(self):
     try:
       if self.running:
         if not self.server_thread_started: self.start()
@@ -446,7 +446,7 @@ class MessengerTest(Test):
     except Timeout:
       assert False, "Timeout waiting for client stop()"
 
-    # need to restart client, as teardown() uses it to stop server
+    # need to restart client, as tearDown() uses it to stop server
     self.client.start()
 
   def testRoute(self):
@@ -696,7 +696,7 @@ class MessengerTest(Test):
 
 class NBMessengerTest(common.Test):
 
-  def setup(self):
+  def setUp(self):
     self.client = Messenger("client")
     self.client2 = Messenger("client2")
     self.server = Messenger("server")
@@ -721,7 +721,7 @@ class NBMessengerTest(common.Test):
     self._pump(timeout, False)
     while self._pump(0, True): pass
 
-  def teardown(self):
+  def tearDown(self):
     self.server.stop()
     self.client.stop()
     self.client2.stop()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/reactor.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/reactor.py b/tests/python/proton_tests/reactor.py
index 5734582..36dc4ca 100644
--- a/tests/python/proton_tests/reactor.py
+++ b/tests/python/proton_tests/reactor.py
@@ -50,7 +50,7 @@ class BarfOnFinal:
 
 class ExceptionTest(Test):
 
-    def setup(self):
+    def setUp(self):
         self.reactor = Reactor()
 
     def test_reactor_final(self):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/reactor_interop.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/reactor_interop.py b/tests/python/proton_tests/reactor_interop.py
index 50284fd..801a417 100644
--- a/tests/python/proton_tests/reactor_interop.py
+++ b/tests/python/proton_tests/reactor_interop.py
@@ -97,7 +97,7 @@ class SendHandler:
 
 class ReactorInteropTest(Test):
 
-  def setup(self):
+  def setUp(self):
     classpath = ""
     if ('CLASSPATH' in os.environ):
       classpath = os.environ['CLASSPATH']

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/sasl.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/sasl.py b/tests/python/proton_tests/sasl.py
index 24ff195..75b4828 100644
--- a/tests/python/proton_tests/sasl.py
+++ b/tests/python/proton_tests/sasl.py
@@ -75,7 +75,7 @@ class Test(common.Test):
 
 class SaslTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.t1 = Transport()
     self.s1 = SASL(self.t1)
     self.t2 = Transport(Transport.SERVER)
@@ -291,7 +291,7 @@ class SaslTest(Test):
     assert self.s2.outcome != SASL.OK
 
 class SASLMechTest(Test):
-  def setup(self):
+  def setUp(self):
     self.t1 = Transport()
     self.s1 = SASL(self.t1)
     self.t2 = Transport(Transport.SERVER)
@@ -366,7 +366,7 @@ def _sslConnection(domain, transport, connection):
   return connection
 
 class SSLSASLTest(Test):
-  def setup(self):
+  def setUp(self):
     if not common.isSSLPresent():
       raise Skipped("No SSL libraries found.")
 
@@ -464,8 +464,8 @@ class SSLSASLTest(Test):
     _testSaslMech(self, mech, clientUser=None, authUser=None, encrypted=None, authenticated=False)
 
 class SASLEventTest(engine.CollectorTest):
-  def setup(self):
-    engine.CollectorTest.setup(self)
+  def setUp(self):
+    engine.CollectorTest.setUp(self)
     self.t1 = Transport()
     self.s1 = SASL(self.t1)
     self.t2 = Transport(Transport.SERVER)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/soak.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/soak.py b/tests/python/proton_tests/soak.py
index 0a6e693..c9ec68e 100644
--- a/tests/python/proton_tests/soak.py
+++ b/tests/python/proton_tests/soak.py
@@ -76,11 +76,11 @@ class AppTests(Test):
     def valgrind_test(self):
         self.is_valgrind = True
 
-    def setup(self):
+    def setUp(self):
         self.senders = []
         self.receivers = []
 
-    def teardown(self):
+    def tearDown(self):
         pass
 
     def _do_test(self, iterations=1):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/ssl.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/ssl.py b/tests/python/proton_tests/ssl.py
index 8432797..961a783 100644
--- a/tests/python/proton_tests/ssl.py
+++ b/tests/python/proton_tests/ssl.py
@@ -40,13 +40,13 @@ class SslTest(common.Test):
         common.Test.__init__(self, *args)
         self._testpath = _testpath
 
-    def setup(self):
+    def setUp(self):
         if not common.isSSLPresent():
             raise Skipped("No SSL libraries found.")
         self.server_domain = SSLDomain(SSLDomain.MODE_SERVER)
         self.client_domain = SSLDomain(SSLDomain.MODE_CLIENT)
 
-    def teardown(self):
+    def tearDown(self):
         self.server_domain = None
         self.client_domain = None
 
@@ -560,10 +560,10 @@ class SslTest(common.Test):
         self._do_handshake( client, server )
         del server
         del client
-        self.teardown()
+        self.tearDown()
 
         # Should fail on CN name mismatch:
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-certificate.pem"),
                                            self._testpath("server-private-key.pem"),
                                            "server-password")
@@ -581,7 +581,7 @@ class SslTest(common.Test):
         assert server.connection.state & Endpoint.REMOTE_UNINIT
         del server
         del client
-        self.teardown()
+        self.tearDown()
 
         # Wildcarded Certificate
         # Assumes:
@@ -591,7 +591,7 @@ class SslTest(common.Test):
         #
 
         # Pass: match an alternate
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                            self._testpath("server-wc-private-key.pem"),
                                            "server-password")
@@ -605,10 +605,10 @@ class SslTest(common.Test):
         self._do_handshake( client, server )
         del client
         del server
-        self.teardown()
+        self.tearDown()
 
         # Pass: match an alternate
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                     self._testpath("server-wc-private-key.pem"),
                                     "server-password")
@@ -622,10 +622,10 @@ class SslTest(common.Test):
         self._do_handshake(client, server)
         del client
         del server
-        self.teardown()
+        self.tearDown()
 
         # Pass: match the pattern
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                     self._testpath("server-wc-private-key.pem"),
                                     "server-password")
@@ -639,10 +639,10 @@ class SslTest(common.Test):
         self._do_handshake( client, server )
         del client
         del server
-        self.teardown()
+        self.tearDown()
 
         # Pass: match the pattern
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                     self._testpath("server-wc-private-key.pem"),
                                     "server-password")
@@ -656,10 +656,10 @@ class SslTest(common.Test):
         self._do_handshake( client, server )
         del client
         del server
-        self.teardown()
+        self.tearDown()
 
         # Fail: must match prefix on wildcard
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                     self._testpath("server-wc-private-key.pem"),
                                     "server-password")
@@ -677,10 +677,10 @@ class SslTest(common.Test):
         assert server.connection.state & Endpoint.REMOTE_UNINIT
         del server
         del client
-        self.teardown()
+        self.tearDown()
 
         # Fail: leading wildcards are not optional
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                     self._testpath("server-wc-private-key.pem"),
                                     "server-password")
@@ -696,11 +696,11 @@ class SslTest(common.Test):
         assert server.transport.closed
         assert client.connection.state & Endpoint.REMOTE_UNINIT
         assert server.connection.state & Endpoint.REMOTE_UNINIT
-        self.teardown()
+        self.tearDown()
 
         # Pass: ensure that the user can give an alternate name that overrides
         # the connection's configured hostname
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
                                     self._testpath("server-wc-private-key.pem"),
                                     "server-password")
@@ -714,11 +714,11 @@ class SslTest(common.Test):
         self._do_handshake(client, server)
         del client
         del server
-        self.teardown()
+        self.tearDown()
 
         # Pass: ensure that the hostname supplied by the connection is used if
         # none has been specified for the SSL instanace
-        self.setup()
+        self.setUp()
         self.server_domain.set_credentials(self._testpath("server-certificate.pem"),
                                     self._testpath("server-private-key.pem"),
                                     "server-password")
@@ -731,7 +731,7 @@ class SslTest(common.Test):
         self._do_handshake(client, server)
         del client
         del server
-        self.teardown()
+        self.tearDown()
 
     def test_defaults_messenger_app(self):
         """ Test an SSL connection using the Messenger apps (no certificates)
@@ -839,7 +839,7 @@ class SslTest(common.Test):
 
 class MessengerSSLTests(common.Test):
 
-    def setup(self):
+    def setUp(self):
         if not common.isSSLPresent():
             raise Skipped("No SSL libraries found.")
         self.server = Messenger()
@@ -847,7 +847,7 @@ class MessengerSSLTests(common.Test):
         self.server.blocking = False
         self.client.blocking = False
 
-    def teardown(self):
+    def tearDown(self):
         self.server.stop()
         self.client.stop()
         self.pump()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b430410b/tests/python/proton_tests/transport.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/transport.py b/tests/python/proton_tests/transport.py
index 786c29e..5a5cea2 100644
--- a/tests/python/proton_tests/transport.py
+++ b/tests/python/proton_tests/transport.py
@@ -29,13 +29,13 @@ class Test(common.Test):
 
 class ClientTransportTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.transport = Transport()
     self.peer = Transport()
     self.conn = Connection()
     self.peer.bind(self.conn)
 
-  def teardown(self):
+  def tearDown(self):
     self.transport = None
     self.peer = None
     self.conn = None
@@ -193,13 +193,13 @@ class ClientTransportTest(Test):
 
 class ServerTransportTest(Test):
 
-  def setup(self):
+  def setUp(self):
     self.transport = Transport(Transport.SERVER)
     self.peer = Transport()
     self.conn = Connection()
     self.peer.bind(self.conn)
 
-  def teardown(self):
+  def tearDOwn(self):
     self.transport = None
     self.peer = None
     self.conn = None


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message