def test_apply_sca_with_undo(): env = {'x': '1', 'PATH': os.pathsep.join(['orig', 'paths'])} e = EnvDelta(scalars={'x': '2', 'y': 'fun/paths'}) env = e.apply(env) f = EnvDelta(scalars={'x': '3', 'z': 'machine'}) exp = {'x': '3', 'PATH': os.pathsep.join(['orig', 'paths']), 'y': 'fun/paths', 'z': 'machine', _undo_key: repr(f)} obs = f.apply(env) assert_equal(exp, obs)
def test_apply_sca(): env = {'x': '1', 'PATH': os.pathsep.join(['orig', 'paths'])} e = EnvDelta(scalars={'x': '2', 'y': 'fun/paths'}) exp = {'x': '2', 'PATH': os.pathsep.join(['orig', 'paths']), 'y': 'fun/paths', _undo_key: repr(e)} obs = e.apply(env) assert_equal(exp, obs)