Skip to content

Commit

Permalink
Fix unittests for 'sets' in python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-hof committed Jun 8, 2017
1 parent 42905e1 commit 8c55dd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Products/PythonScripts/tests/testPythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
##############################################################################
import os
import six
import unittest
import warnings

Expand Down Expand Up @@ -224,7 +225,12 @@ def testGetSize(self):
f = self._filePS('complex_print')
self.assertEqual(f.get_size(), len(f.read()))

def testSet(self):
def testBuiltinSet(self):
res = self._newPS('return len(set([1, 2, 3, 1]))')()
self.assertEqual(res, 3)

@unittest.skipIf(six.PY3, 'sets module does not exist in python3')
def testSetModule(self):
res = self._newPS('from sets import Set; return len(Set([1,2,3]))')()
self.assertEqual(res, 3)

Expand Down

0 comments on commit 8c55dd9

Please sign in to comment.