Ejemplo n.º 1
0
    def test_axiomaticCommandProvides(self):
        """
        Test that AxiomaticCommand itself does not provide IAxiomaticCommand or
        IPlugin, but subclasses do.
        """
        self.failIf(IAxiomaticCommand.providedBy(axiomatic.AxiomaticCommand), 'IAxiomaticCommand provided')
        self.failIf(IPlugin.providedBy(axiomatic.AxiomaticCommand), 'IPlugin provided')

        class _TestSubClass(axiomatic.AxiomaticCommand):
            pass

        self.failUnless(IAxiomaticCommand.providedBy(_TestSubClass), 'IAxiomaticCommand not provided')
        self.failUnless(IPlugin.providedBy(_TestSubClass), 'IPlugin not provided')
Ejemplo n.º 2
0
    def test_axiomaticCommandProvides(self):
        """
        Test that AxiomaticCommand itself does not provide IAxiomaticCommand or
        IPlugin, but subclasses do.
        """
        self.failIf(IAxiomaticCommand.providedBy(axiomatic.AxiomaticCommand), 'IAxiomaticCommand provided')
        self.failIf(IPlugin.providedBy(axiomatic.AxiomaticCommand), 'IPlugin provided')

        class _TestSubClass(axiomatic.AxiomaticCommand):
            pass

        self.failUnless(IAxiomaticCommand.providedBy(_TestSubClass), 'IAxiomaticCommand not provided')
        self.failUnless(IPlugin.providedBy(_TestSubClass), 'IPlugin not provided')
Ejemplo n.º 3
0
 def test_providesInterfaces(self):
     """
     Verify that the necessary interfaces for the object to be found as a
     twistd subcommand plugin are provided.
     """
     self.failUnless(IPlugin.providedBy(widgetServiceMaker))
     self.failUnless(IServiceMaker.providedBy(widgetServiceMaker))
Ejemplo n.º 4
0
 def test_plugin(self):
     """
     :obj:`twisted.plugins.mimic.mimicService` is a twistd plugin
     referencing `mimic.tap.makeService`.
     """
     self.assertTrue(IPlugin.providedBy(mimicService))
     self.assertTrue(IServiceMaker.providedBy(mimicService))
     self.assertIs(mimicService.makeService, makeService)
Ejemplo n.º 5
0
 def test_plugin(self):
     """
     :obj:`twisted.plugins.mimic.mimicService` is a twistd plugin
     referencing `mimic.tap.makeService`.
     """
     self.assertTrue(IPlugin.providedBy(mimicService))
     self.assertTrue(IServiceMaker.providedBy(mimicService))
     self.assertIs(mimicService.makeService, makeService)