Exemplo n.º 1
0
	def testKnownHash(self):
		"""
		Test hash can be fetched thru ExtensionInfo
                """
		self.loading_check()
		hash1=ExtensionSecureID.fromPathName(self.plugin_info[0].path+".py")
		self.assertEquals(hash1,self.plugin_info[0].getSecureID())
		self.assertNotEquals(self.plugin_info[0].getSecureID(),self.plugin_info[1].getSecureID())
Exemplo n.º 2
0
    def setUp(self):
        #1. Get First.py, make hash and add to 
        #   config object.
        extpath=os.path.join( os.path.dirname(os.path.abspath(__file__)),"Plugins")
        trustedp=ExtensionSecureID.fromPathName(os.path.join(extpath,"First.py"))
        self.config = { "FirstPlugin" : trustedp }        
    
        #2. Create Trustmanager class and collect plugins.
        self.myPluginManager = TrustedPluginManager(
                directories_list=[ extpath ], 
                plugin_info_ext="mm-plugin",  
                trustList=[ self.config ] )

        self.myPluginManager.locatePlugins()
        # Will be used later
        self.plugin_info = None
Exemplo n.º 3
0
	def testHashoFHash(self):
		hash1=ExtensionSecureID.fromHash(self.testpath, self.cfvalue)
		hash2=ExtensionSecureID.fromPathName(self.testpath)
		self.assertEqual(hash1.__hash__() , hash2.__hash__() )
Exemplo n.º 4
0
	def testKnownHash(self):
		hash1=ExtensionSecureID.fromHash(self.testpath, self.cfvalue)
		self.assertEqual( str(hash1) , self.cfvalue )
		self.assertEqual( hash1 , self.cfvalue )
		hash2=ExtensionSecureID.fromPathName(self.testpath)
		self.assertEqual(hash1 , hash2 )
Exemplo n.º 5
0
	def testStr(self):
		a=ExtensionSecureID.fromPathName(self.testpath)
		self.assertEqual( str(a) ,self.cfvalue)
Exemplo n.º 6
0
	def testBasic(self):
		hash1=ExtensionSecureID.fromPathName(self.testpath)
		hash2=ExtensionSecureID.fromPathName(self.testpath)
		self.assertEquals( hash1 , hash2 )