diff options
author | rcoh <rcoh@mit.edu> | 2011-02-05 22:34:34 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-02-05 22:34:34 -0500 |
commit | 06c639db6b98affab4abf07e57a90e2fcb5402ef (patch) | |
tree | 3dad66f7c131272cafad5304327cec0d3cf5bd62 /tests | |
parent | 9b134eb47a93c2317519c07dc5a3c3522c9fa2f4 (diff) |
Early stages of param-binding in xml. Functional. RCOH
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TestConfigLoaders.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/TestConfigLoaders.py b/tests/TestConfigLoaders.py index c79bbf1..c7e2b7a 100644 --- a/tests/TestConfigLoaders.py +++ b/tests/TestConfigLoaders.py @@ -29,6 +29,13 @@ class TestConfigLoaders(unittest.TestCase): result.write('tests/testdata/inheritanceTESTout.xml') assert filecmp.cmp('tests/testdata/inheritanceTESTout.xml',\ 'tests/testdata/inheritanceTRUTH.xml') - + #Tests our fancy new XML Eval Function + def test_eval(self): + assert Config.attemptEval('5') == 5 + assert Config.attemptEval('{5:10, 12:15}') == {5:10, 12:15} + singleLayerLambda = Config.attemptEval('${Val}$*5') + assert singleLayerLambda({'Val':2}) == 10 + doubleLayerLambda = Config.attemptEval("${Val1}$*'${Val2}$'") + assert doubleLayerLambda({'Val1':3})({'Val2':7}) == 21 if __name__ == '__main__': unittest.main() |