def testApplyDisabledPackageConfiguration( self ): packageFolder = os.path.join( self.TEST_MOM_ENVIRONMENTS, 'dep-a-1.2.0' ) packageFile = os.path.join( packageFolder, Dependency._ControlFileName ) self.assertTrue( os.path.exists( packageFile ) ) dep = Dependency() dep.setFolder( packageFolder ) self.assertTrue( dep._readControlFile( packageFile ) ) self.assertTrue( not dep.isEnabled() ) self.assertEquals( dep.getObjectStatus(), 'test-disabled-dep-a-1.2.0' ) self.assertEquals( dep.getScore(), 120 )
def testApplyPackageConfiguration( self ): packageFolder = os.path.join( self.TEST_MOM_ENVIRONMENTS, 'dep-a-1.1.0' ) packageFile = os.path.join( packageFolder, Dependency._ControlFileName ) self.assertTrue( os.path.exists( packageFile ) ) dep = Dependency() dep.setFolder( packageFolder ) self.assertTrue( dep._readControlFile( packageFile ) ) self.assertTrue( dep.isEnabled() ) self.assertEquals( dep.getObjectStatus(), 'test-dep-a-1.1.0' ) with EnvironmentSaver(): dep.apply() self.assertEquals( os.environ[ 'EXAMPLE_VARIABLE'], 'example_variable' ) self.assertTrue( os.environ['PATH'].startswith( 'example_path' ) )