def test_load_file(): a = Amply("param T:= 4; param X{foo};") s = StringIO("param S := 6; param X := 1 2;") a.load_file(s) assert a.T == 4 assert a.S == 6 assert a.X[1] == 2
def test_load_file(): a = Amply("param T:= 4; param X{foo};") try: s = StringIO("param S := 6; param X := 1 2;") except TypeError: s = StringIO(u"param S := 6; param X := 1 2;") a.load_file(s) assert a.T == 4 assert a.S == 6 assert a.X[1] == 2