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())
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
def testHashoFHash(self): hash1=ExtensionSecureID.fromHash(self.testpath, self.cfvalue) hash2=ExtensionSecureID.fromPathName(self.testpath) self.assertEqual(hash1.__hash__() , hash2.__hash__() )
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 )
def testStr(self): a=ExtensionSecureID.fromPathName(self.testpath) self.assertEqual( str(a) ,self.cfvalue)
def testBasic(self): hash1=ExtensionSecureID.fromPathName(self.testpath) hash2=ExtensionSecureID.fromPathName(self.testpath) self.assertEquals( hash1 , hash2 )