diff --git a/test/test_random_expression.py b/test/test_random_expression.py index f69a627..bed6114 100644 --- a/test/test_random_expression.py +++ b/test/test_random_expression.py @@ -77,9 +77,18 @@ class TestRandomExpression(unittest.TestCase): def test_only_form_calc_cond_calc(self): - form = "{a} + 2" + form = "{a*3} * {b}" + cond = ["{a + b} == 3"] + rdExp = RdExpression(form, cond) - pass + self.assertEqual(rdExp._letters, {'a', 'b'}) + self.assertEqual(rdExp._2replaced, {'b', 'a*3', 'a + b'}) + + rdExp() + self.assertEqual(set(rdExp._gene_varia.keys()), {'a', 'b'}) + self.assertEqual(set(rdExp._gene_2replaced.keys()), {'b', 'a*3', 'a + b'}) + + self.assertEqual((rdExp._gene_varia['a'] + rdExp._gene_varia['b']), 3)