Add on test in test_random_expression
This commit is contained in:
parent
3c5193d1c4
commit
2aed89855f
@ -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)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user