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
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')
def test_get_environment_var(self): self.assertNotEqual(shell.env('foo'), 'bar') os.environ['foo'] = 'bar' self.assertEqual(shell.env('foo'), 'bar')