Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Rename _testService() to service()

  • Loading branch information
wsanchez committed Feb 21, 2013
1 parent 58d6d00 commit 580c461e4a88a0ac047d1a423542b5f6400d0134
Showing with 52 additions and 52 deletions.
  1. +9 −9 twext/who/test/test_directory.py
  2. +43 −43 twext/who/test/test_xml.py
@@ -35,7 +35,7 @@ class BaseTest(unittest.TestCase):
realmName = "xyzzy"


def _testService(self):
def service(self):
if not hasattr(self, "_service"):
self._service = DirectoryService(self.realmName)
return self._service
@@ -44,26 +44,26 @@ def _testService(self):

class DirectoryServiceTest(BaseTest):
def test_interface(self):
service = self._testService()
service = self.service()
try:
verifyObject(IDirectoryService, service)
except BrokenMethodImplementation as e:
self.fail(e)


def test_init(self):
service = self._testService()
service = self.service()
self.assertEquals(service.realmName, self.realmName)


def test_repr(self):
service = self._testService()
service = self.service()
self.assertEquals(repr(service), "<DirectoryService 'xyzzy'>")


@inlineCallbacks
def test_recordTypes(self):
service = self._testService()
service = self.service()
self.assertEquals(
set((yield service.recordTypes())),
set(service.recordType.iterconstants())
@@ -72,14 +72,14 @@ def test_recordTypes(self):

@inlineCallbacks
def test_recordsFromQueryNone(self):
service = self._testService()
service = self.service()
records = (yield service.recordsFromQuery(()))
for record in records:
self.failTest("No records expected")


def test_recordsFromQueryBogus(self):
service = self._testService()
service = self.service()
self.assertFailure(service.recordsFromQuery((object(),)), QueryNotSupportedError)


@@ -130,7 +130,7 @@ def _testRecord(self, fields=None, service=None):
if fields is None:
fields = self.fields_wsanchez
if service is None:
service = self._testService()
service = self.service()
return DirectoryRecord(service, fields)


@@ -143,7 +143,7 @@ def test_interface(self):


def test_init(self):
service = self._testService()
service = self.service()
wsanchez = self._testRecord(self.fields_wsanchez, service=service)

self.assertEquals(wsanchez.service, service)

0 comments on commit 580c461

Please sign in to comment.
You can’t perform that action at this time.