Beispiel #1
0
    def testResourceArguments(self):
        myPluggedResource = plugin.resourcePlugger('TestResource',
                                            'Foo', bar='Bar')
        
        assert isinstance(myPluggedResource, plugin.TestResource)

        self.assertEquals(myPluggedResource.foo, 'Foo')
        self.assertEquals(myPluggedResource.bar, 'Bar')
Beispiel #2
0
    def testResourceArguments(self):
        myPluggedResource = plugin.resourcePlugger('TestResource',
                                                   'Foo',
                                                   bar='Bar')

        assert isinstance(myPluggedResource, plugin.TestResource)

        self.assertEquals(myPluggedResource.foo, 'Foo')
        self.assertEquals(myPluggedResource.bar, 'Bar')
Beispiel #3
0
 def testResource(self):
     assert isinstance(plugin.resourcePlugger('TestResource'),
                       plugin.TestResource)
Beispiel #4
0
    def testDefaultPlugin(self):
        myPluggedResource = plugin.resourcePlugger('NoSuchResource',
                                                   defaultResource=MyDefaultResource)

        assert isinstance(myPluggedResource, MyDefaultResource)
Beispiel #5
0
 def testNoPlugin(self):
     myPluggedResource = plugin.resourcePlugger('NoSuchResource')
     
     assert isinstance(myPluggedResource, plugin.NoPlugin)
     
     self.assertEquals(myPluggedResource.plugin, 'NoSuchResource')
Beispiel #6
0
    def testDefaultPlugin(self):
        myPluggedResource = plugin.resourcePlugger(
            'NoSuchResource', defaultResource=MyDefaultResource)

        assert isinstance(myPluggedResource, MyDefaultResource)
Beispiel #7
0
    def testNoPlugin(self):
        myPluggedResource = plugin.resourcePlugger('NoSuchResource')

        assert isinstance(myPluggedResource, plugin.NoPlugin)

        self.assertEquals(myPluggedResource.plugin, 'NoSuchResource')
Beispiel #8
0
 def testResource(self):
     assert isinstance(plugin.resourcePlugger('TestResource'),
                       plugin.TestResource)