Exemplo n.º 1
0
class testZip(unittest.TestCase):
    def setUp(self):
        self.L = Registry()

        # Create module
        import zipfile
        z = zipfile.PyZipFile("plugins.zip", 'w')
        z.writepy("../plugins", "")
        z.close()

    def testplugin_checksetup(self):
        """ 
            Check that the test is valid by confirming
            that the file can't be loaded without the
            plugins
        """
        self.assertRaises(ValueError, self.L.load, 'test_data.test')

    def testplugin(self):
        """ 
            test loading with a test reader only 
            found in the plugins directory
        """
        self.L.find_plugins('.')
        output = self.L.load('test_data.test')
        self.assertEqual(output.x[0], 1234.)
        self.assertTrue(self.L.loaders.has_key('.test'))
Exemplo n.º 2
0
class testZip(unittest.TestCase):
    
    def setUp(self):
        self.L=Registry()
        
        # Create module
        import zipfile
        z = zipfile.PyZipFile("plugins.zip", 'w')
        z.writepy("../plugins", "")
        z.close()
        
    def testplugin_checksetup(self):
        """ 
            Check that the test is valid by confirming
            that the file can't be loaded without the
            plugins
        """
        self.assertRaises(ValueError, self.L.load, 'test_data.test')
        
    def testplugin(self):
        """ 
            test loading with a test reader only 
            found in the plugins directory
        """
        self.L.find_plugins('.')
        output = self.L.load('test_data.test')
        self.assertEqual(output.x[0], 1234.)
        self.assertTrue(self.L.loaders.has_key('.test'))
Exemplo n.º 3
0
class testRegistry(unittest.TestCase):
    def setUp(self):
        self.L = Registry()
        self.L.find_plugins('../plugins')

    def testplugin(self):
        """ 
            test loading with a test reader only 
            found in the plugins directory
        """
        output = self.L.load('test_data.test')
        self.assertEqual(output.x[0], 1234.)
        self.assertTrue(self.L.loaders.has_key('.test'))
Exemplo n.º 4
0
class testRegistry(unittest.TestCase):
    
    def setUp(self):
        self.L=Registry()
        self.L.find_plugins('../plugins')
            
    def testplugin(self):
        """ 
            test loading with a test reader only 
            found in the plugins directory
        """
        output = self.L.load('test_data.test')
        self.assertEqual(output.x[0], 1234.)
        self.assertTrue(self.L.loaders.has_key('.test'))