def testSystem( self ):
        """test system and environment functionality"""
        org = os.environ
        self._testCmds( javashell._shellEnv, testCmds, "default" )

        # trigger initialization of environment
        os.environ[ key ] = value

        assert org.get( key, None ) == value, \
                "expected stub to have %s set" % key
        assert os.environ.get( key, None ) == value, \
                "expected real os.environment to have %s set" % key

        # if environment is initialized and jython gets ARGS=-i, it thinks
        # it is running in interactive mode, and fails to exit until
        # process.getOutputStream().close()
        try:
            del os.environ[ "ARGS" ]
        except __HOLE__:
            pass

        # test system using the non-default environment
        self._testCmds( javashell._shellEnv, testCmds, "initialized" )

        assert os.environ.has_key( "PATH" ), \
                "expected environment to have PATH attribute " \
                "(this may not apply to all platforms!)"
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_javashell.py/JavaShellTest.testSystem