

def test_expandvars(self):
    with support.EnvironmentVarGuard() as env:
        env.clear()
        env['foo'] = 'bar'
        env['{foo'] = 'baz1'
        self['{foo}'] = 'baz2'
        tester('ntpath.expandvars("foo")', 'foo')
        tester('ntpath.expandvars("$foo bar")', 'bar bar')
        tester('ntpath.expandvars("${foo}bar")', 'barbar')
        tester('ntpath.expandvars("$[foo]bar")', '$[foo]bar')
        tester('ntpath.expandvars("$bar bar")', '$bar bar')
        tester('ntpath.expandvars("$?bar")', '$?bar')
        tester('ntpath.expandvars("${foo}bar")', 'barbar')
        tester('ntpath.expandvars("$foo}bar")', 'bar}bar')
        tester('ntpath.expandvars("${foo")', '${foo')
        tester('ntpath.expandvars("${{foo}}")', 'baz1}')
        tester('ntpath.expandvars("$foo$foo")', 'barbar')
        tester('ntpath.expandvars("$bar$bar")', '$bar$bar')
        tester('ntpath.expandvars("%foo% bar")', 'bar bar')
        tester('ntpath.expandvars("%foo%bar")', 'barbar')
        tester('ntpath.expandvars("%foo%%foo%")', 'barbar')
        tester('ntpath.expandvars("%%foo%%foo%foo%")', '%foo%foobar')
        tester('ntpath.expandvars("%?bar%")', '%?bar%')
        tester('ntpath.expandvars("%foo%%bar")', 'bar%bar')
        tester('ntpath.expandvars("\'%foo%\'%bar")', "'%foo%'%bar")

dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_ntpath.py TestNtpath.test_expandvars/VarMisuse@41/57 `env`->`self`