Skip to content

Commit

Permalink
lint more files
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed Oct 4, 2018
1 parent 51360ac commit 53cd16f
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 61 deletions.
12 changes: 6 additions & 6 deletions src/OFS/tests/testAcquisition.py
Expand Up @@ -11,19 +11,19 @@
#
##############################################################################

import unittest

from Testing.makerequest import makerequest

from OFS.SimpleItem import SimpleItem
from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import view_management_screens
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.Permissions import view_management_screens
from AccessControl.ZopeGuards import guarded_getattr
from OFS.SimpleItem import SimpleItem
from Testing.makerequest import makerequest

import unittest
import Zope2


Zope2.startup_wsgi()


Expand Down
1 change: 1 addition & 0 deletions src/OFS/tests/testApplication.py
@@ -1,4 +1,5 @@
from Testing.ZopeTestCase import FunctionalTestCase

import unittest


Expand Down
3 changes: 2 additions & 1 deletion src/OFS/tests/testChownRecursive.py
Expand Up @@ -11,9 +11,10 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import unittest
from Testing import ZopeTestCase

import unittest


class TestRecursiveChangeOwnership(ZopeTestCase.ZopeTestCase):
user_name2 = "dumdidum"
Expand Down
19 changes: 9 additions & 10 deletions src/OFS/tests/testCopySupportEvents.py
@@ -1,19 +1,18 @@
import unittest
import Zope2

import transaction

from zope import component
from zope import interface
from zope.interface.interfaces import IObjectEvent
from zope.testing import cleanup

from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from OFS.Folder import Folder
from OFS.SimpleItem import SimpleItem
from Testing.makerequest import makerequest
from zope import component
from zope import interface
from Zope2.App import zcml
from zope.interface.interfaces import IObjectEvent
from zope.testing import cleanup

import transaction
import unittest
import Zope2


Zope2.startup_wsgi()

Expand Down
41 changes: 18 additions & 23 deletions src/OFS/tests/testFileAndImage.py
@@ -1,37 +1,32 @@
# -*- coding: utf-8 -*-
import unittest

import Zope2

import codecs
import os
import sys
import time
from io import BytesIO

from Acquisition import aq_base
from six import PY3

from App.Common import rfc1123_date
from io import BytesIO
from OFS.Application import Application
from OFS.SimpleItem import SimpleItem
from OFS.Cache import ZCM_MANAGERS
from OFS.Image import Pdata
from ZPublisher.HTTPRequest import HTTPRequest
from ZPublisher.HTTPResponse import HTTPResponse
from App.Common import rfc1123_date
from OFS.SimpleItem import SimpleItem
from six import PY3
from Testing.makerequest import makerequest
from zExceptions import Redirect
import Testing.ZopeTestCase
import Testing.testbrowser
import transaction

import OFS.Image

from zope.component import adapter
from zope.lifecycleevent.interfaces import IObjectModifiedEvent
from zope.lifecycleevent.interfaces import IObjectCreatedEvent
from zope.lifecycleevent.interfaces import IObjectModifiedEvent
from ZPublisher.HTTPRequest import HTTPRequest
from ZPublisher.HTTPResponse import HTTPResponse

import codecs
import OFS.Image
import os
import six
import sys
import Testing.testbrowser
import Testing.ZopeTestCase
import time
import transaction
import unittest
import Zope2


here = os.path.dirname(os.path.abspath(__file__))
filedata = os.path.join(here, 'test.gif')
Expand Down
5 changes: 2 additions & 3 deletions src/OFS/tests/testLockable.py
@@ -1,8 +1,7 @@
import unittest

from OFS.interfaces import IWriteLock
from zope.interface import implementer

from OFS.interfaces import IWriteLock
import unittest


@implementer(IWriteLock)
Expand Down
23 changes: 13 additions & 10 deletions src/OFS/tests/testObjectManager.py
@@ -1,25 +1,28 @@
# -*- coding: utf-8 -*-
from logging import getLogger
import unittest

from AccessControl.owner import EmergencyUserCannotOwn
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from AccessControl.SpecialUsers import emergency_user, nobody, system
from AccessControl.SpecialUsers import emergency_user
from AccessControl.SpecialUsers import nobody
from AccessControl.SpecialUsers import system
from AccessControl.User import User # before SpecialUsers
from Acquisition import aq_self, Implicit
from six import PY2
from zExceptions import BadRequest
from zope.component.testing import PlacelessSetup
from zope.interface import implementer

from Acquisition import aq_self
from Acquisition import Implicit
from App.config import getConfiguration
from logging import getLogger
from OFS.interfaces import IItem
from OFS.metaconfigure import setDeprecatedManageAddDelete
from OFS.ObjectManager import ObjectManager
from OFS.SimpleItem import SimpleItem
from six import PY2
from zExceptions import BadRequest
from Zope2.App import zcml
from zope.component.testing import PlacelessSetup
from zope.interface import implementer

import unittest


logger = getLogger('OFS.subscribers')

Expand Down
2 changes: 1 addition & 1 deletion src/OFS/tests/testSorting.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import codecs
import Testing.ZopeTestCase
import Testing.testbrowser
import Testing.ZopeTestCase
import Zope2.App


Expand Down
3 changes: 2 additions & 1 deletion src/OFS/tests/test_Uninstalled.py
Expand Up @@ -11,10 +11,11 @@
#
##############################################################################

import unittest
from OFS.SimpleItem import SimpleItem
from Testing.ZopeTestCase import base

import unittest


class ToBreak(SimpleItem):
pass
Expand Down
6 changes: 3 additions & 3 deletions src/OFS/tests/test_registerclass.py
Expand Up @@ -17,7 +17,6 @@
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from OFS.SimpleItem import SimpleItem

from zope.interface import implementer
from zope.interface import Interface

Expand All @@ -36,16 +35,17 @@ def __init__(self, id, title):
self.id = id
self.title = title

security.declarePublic('mymethod')
@security.public()
def mymethod(self):
return "Hello world"

security.declarePublic('direct')
@security.public()
def direct(self):
"""Should be able to traverse directly to this as there is no view.
"""
return "Direct traversal worked"


InitializeClass(SimpleContent)


Expand Down
6 changes: 4 additions & 2 deletions src/OFS/tests/test_registerpackage.py
Expand Up @@ -13,11 +13,13 @@
##############################################################################
"""Unit tests for the registerPackage directive.
"""
import sys

# need to add the testing package to the pythonpath in order to
# test python-packages-as-products
from Products.Five.tests import testing

import sys


sys.path.append(testing.__path__[0])


Expand Down
3 changes: 2 additions & 1 deletion src/OFS/tests/test_userfolder.py
Expand Up @@ -13,9 +13,10 @@
""" Unit tests for OFS.userfolder
"""

from ZPublisher.utils import basic_auth_encode

import unittest

from ZPublisher.utils import basic_auth_encode

# TODO class Test_readUserAccessFile(unittest.TestCase)

Expand Down

0 comments on commit 53cd16f

Please sign in to comment.