Beispiel #1
0
    def set_locals(self, dir, appname, reload=True):
#        os.chdir(dir)
        import shell
        import types
        
        locals = shell.env(appname, dir=dir)
        if reload:
            for k, v in locals.items():
                if isinstance(v, types.ModuleType):
                    reload(v)
        self.interp.locals = locals
Beispiel #2
0
    def set_locals(self, dir, appname, reload=True):
        #        os.chdir(dir)
        import shell
        import types

        locals = shell.env(appname, dir=dir)
        if reload:
            for k, v in locals.items():
                if isinstance(v, types.ModuleType):
                    reload(v)
        self.interp.locals = locals
Beispiel #3
0
 def test_expand_environment_var(self):
     self.assertNotEqual(shell.env('foo'), 'barbar')
     os.environ['foo'] = 'barbar'
     self.assertEqual(shell.ex('echo $foo').stdout(), b'barbar\n')
Beispiel #4
0
 def test_get_environment_var(self):
     self.assertNotEqual(shell.env('foo'), 'bar')
     os.environ['foo'] = 'bar'
     self.assertEqual(shell.env('foo'), 'bar')
Beispiel #5
0
 def test_expand_environment_var(self):
     self.assertNotEqual(shell.env('foo'), 'barbar')
     os.environ['foo'] = 'barbar'
     self.assertEqual(shell.ex('echo $foo').stdout(), b'barbar\n')
Beispiel #6
0
 def test_get_environment_var(self):
     self.assertNotEqual(shell.env('foo'), 'bar')
     os.environ['foo'] = 'bar'
     self.assertEqual(shell.env('foo'), 'bar')