Dan Kenigsberg has uploaded a new change for review.
Change subject: apiTests: silence testMissingSize failure on Python 2.6 ......................................................................
apiTests: silence testMissingSize failure on Python 2.6
I did not delve into the reasons of this, but on Python 2.6, testMissingSize raises socket.error instead of struct.error.
Change-Id: I6d69ec07234c73a884abdc615a33c6b6508b47f5 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M tests/apiTests.py 1 file changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/9442/1
diff --git a/tests/apiTests.py b/tests/apiTests.py index ff0a785..4100ad0 100644 --- a/tests/apiTests.py +++ b/tests/apiTests.py @@ -25,6 +25,7 @@ import errno import json import struct +import sys
from testrunner import VdsmTestCase as TestCaseBase from vdsm import constants @@ -73,7 +74,6 @@ self.lastFunc = name return self.default
- import sys import imp from new import classobj
@@ -227,7 +227,12 @@ self.assertEquals(4, reply['error']['code'])
def testMissingSize(self): - self.assertRaises(struct.error, self.sendMessage, + if sys.version_info[0:2] == (2, 6): + expectedException = socket.error + else: + expectedException = struct.error + + self.assertRaises(expectedException, self.sendMessage, "malformed message")
def testClientNotJson(self):
-- To view, visit http://gerrit.ovirt.org/9442 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I6d69ec07234c73a884abdc615a33c6b6508b47f5 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com