You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2018/10/15 18:47:57 UTC

[3/3] qpid-proton git commit: NO-JIRA: [c, cpp] monkey-patch python 2.7 unittest features for python 2.6

NO-JIRA: [c,cpp] monkey-patch python 2.7 unittest features for python 2.6


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

Branch: refs/heads/master
Commit: 994db75c949412c60b31abc4b4c2279ebb956201
Parents: 8b29f41
Author: Alan Conway <ac...@redhat.com>
Authored: Mon Oct 15 14:46:22 2018 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Mon Oct 15 14:46:22 2018 -0400

----------------------------------------------------------------------
 c/examples/testme         |  2 +-
 cpp/examples/testme       |  3 ++-
 tests/py/test_unittest.py | 28 ++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/994db75c/c/examples/testme
----------------------------------------------------------------------
diff --git a/c/examples/testme b/c/examples/testme
index c498293..a405679 100755
--- a/c/examples/testme
+++ b/c/examples/testme
@@ -21,7 +21,7 @@
 # Run the C examples and verify that they behave as expected.
 # Example executables must be in PATH
 
-import unittest
+from test_unittest import unittest
 
 from test_subprocess import Popen, Server, TestProcessError, check_output
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/994db75c/cpp/examples/testme
----------------------------------------------------------------------
diff --git a/cpp/examples/testme b/cpp/examples/testme
index 5f30f23..ed642e9 100755
--- a/cpp/examples/testme
+++ b/cpp/examples/testme
@@ -21,7 +21,8 @@
 # Run the C++ examples and verify that they behave as expected.
 # Example executables must be in PATH
 
-import unittest, sys, shutil, os, errno
+import sys, shutil, os, errno
+from test_unittest import  unittest
 from test_subprocess import Popen, TestProcessError, check_output
 import test_subprocess
 from os.path import dirname

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/994db75c/tests/py/test_unittest.py
----------------------------------------------------------------------
diff --git a/tests/py/test_unittest.py b/tests/py/test_unittest.py
new file mode 100644
index 0000000..afc863b
--- /dev/null
+++ b/tests/py/test_unittest.py
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License
+#
+
+import unittest
+
+def assertMultiLineEqual(self, a, b, msg=None): self.assertEqual(a,b,msg)
+unittest.TestCase.assertMultiLineEqual = assertMultiLineEqual
+
+def assertIn(self, a, b, msg=None): self.assertTrue(a in b,msg)
+unittest.TestCase.assertIn = assertIn
+
+


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