test_service.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. """
  4. Tests for L{twisted.application.service}.
  5. """
  6. from __future__ import absolute_import, division
  7. from zope.interface.verify import verifyObject
  8. from twisted.persisted.sob import IPersistable
  9. from twisted.application.service import Application, IProcess
  10. from twisted.application.service import IService, IServiceCollection
  11. from twisted.trial.unittest import TestCase
  12. class ApplicationTests(TestCase):
  13. """
  14. Tests for L{twisted.application.service.Application}.
  15. """
  16. def test_applicationComponents(self):
  17. """
  18. Check L{twisted.application.service.Application} instantiation.
  19. """
  20. app = Application('app-name')
  21. self.assertTrue(verifyObject(IService, IService(app)))
  22. self.assertTrue(
  23. verifyObject(IServiceCollection, IServiceCollection(app)))
  24. self.assertTrue(verifyObject(IProcess, IProcess(app)))
  25. self.assertTrue(verifyObject(IPersistable, IPersistable(app)))