Skip to content

Commit

Permalink
fix assertIsInstance not available in Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Apr 26, 2017
1 parent 7051766 commit 4bdaac7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plone/namedfile/tests/test_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def testCreateScale(self):
foo = self.scaling.scale('image', width=100, height=80)
self.assertTrue(foo.uid)
self.assertEqual(foo.mimetype, 'image/jpeg')
self.assertIsInstance(foo.mimetype, str)
self.assertTrue(isinstance(foo.mimetype, str))
self.assertEqual(foo.data.contentType, 'image/jpeg')
self.assertIsInstance(foo.data.contentType, str)
self.assertTrue(isinstance(foo.data.contentType, str))
self.assertEqual(foo.width, 80)
self.assertEqual(foo.height, 80)
self.assertImage(foo.data.data, 'JPEG', (80, 80))
Expand All @@ -81,9 +81,9 @@ def testGetScaleByName(self):
foo = self.scaling.scale('image', scale='foo')
self.assertTrue(foo.uid)
self.assertEqual(foo.mimetype, 'image/jpeg')
self.assertIsInstance(foo.mimetype, str)
self.assertTrue(isinstance(foo.mimetype, str))
self.assertEqual(foo.data.contentType, 'image/jpeg')
self.assertIsInstance(foo.data.contentType, str)
self.assertTrue(isinstance(foo.data.contentType, str))
self.assertEqual(foo.width, 60)
self.assertEqual(foo.height, 60)
self.assertImage(foo.data.data, 'JPEG', (60, 60))
Expand Down

1 comment on commit 4bdaac7

@jenkins-plone-org
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thet Jenkins CI reporting about code analysis
See the full report here: http://jenkins.plone.org/job/package-plone.namedfile/21/violations

plone/namedfile/scaling.py:248:1: C901 'ImageScaling.create' is too complex (13)
plone/namedfile/interfaces.py:68:38: Q000 Remove bad quotes.
plone/namedfile/editor.py:39:1: E305 expected 2 blank lines after class or function definition, found 1
plone/namedfile/editor.py:74:1: E305 expected 2 blank lines after class or function definition, found 1
plone/namedfile/field.py:26:17: Q000 Remove bad quotes.
plone/namedfile/marshaler.py:8:1: C901 'If 8' is too complex (13)
plone/namedfile/file.py:291:1: C901 'getImageInfo' is too complex (15)
plone/namedfile/tests/base.py:27:1: E305 expected 2 blank lines after class or function definition, found 1
plone/namedfile/tests/base.py:54:16: P301 format call provides unused index (1)
plone/namedfile/tests/test_doctests.py:32:1: E305 expected 2 blank lines after class or function definition, found 1
plone/namedfile/tests/test_scaling.py:97:20: S001 found module formatter
plone/namedfile/tests/test_scaling.py:115:14: D001 found failIf( replace it with assertFalse
plone/namedfile/tests/test_scaling.py:164:20: S001 found module formatter
plone/namedfile/tests/test_scaling.py:172:20: S001 found module formatter
plone/namedfile/tests/test_scaling.py:180:20: S001 found module formatter
plone/namedfile/tests/test_scaling.py:221:20: S001 found module formatter

Follow these instructions to reproduce it locally.

Please sign in to comment.