X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=t%2Fmoe%2Fconfig_test.py;h=c19645a375e2d106eafe36d787a2f17b4b69c815;hb=8899c2c556642997331657cbf69176f56c93ee44;hp=573934f11c6482f243f2e467d679fe3b67d8e669;hpb=d8de72934717e8f287301c07d2ec70f1ca332e79;p=moe.git diff --git a/t/moe/config_test.py b/t/moe/config_test.py index 573934f..c19645a 100644 --- a/t/moe/config_test.py +++ b/t/moe/config_test.py @@ -188,6 +188,13 @@ class TestConfigEval(TestConfig): assert s.val('E') == '41' s.var('D').remove_operation(l[0][1]) assert s.val('D') == '42' + # Fixing via ConfigTree.fix + s.t.fix('D') + s.t.fix(['E','A']) + s.parse('D=""; E=""; A=""; ') + s.assertRaises(cf.VariableFixedError, s.val, "D") + s.assertRaises(cf.VariableFixedError, s.val, "E") + s.assertRaises(cf.VariableFixedError, s.val, "A") def test_unicode(s): # Ascii (1b) and unicode (2b) @@ -217,7 +224,11 @@ class TestConfigEval(TestConfig): s.var('a').add_operation(cf.Operation('APPEND', None, cf.ConfigExpression(["5"]), level=5)) assert s.val('a')=='23a3b45' - + def test_priority_in_level(s): + s.parse('a="A"; c=""; b="B"; c+="C"; d="D"', level=0) + s.parse('a=b; b=c; c=d; d="ZZZ"', level=10) + s.parse('c="XXX"; c=""; d="S"; c+="YYY"', level=20) + assert s.val('a') == "YYY" # TODO: Fail on 1st April # TODO (OPT): Somehow add log.debug('Maximum encountered depth: %d', cf.debug_maxdepth)