示例#1
0
 def test_evaluate_properties_for_name_errors(self):
     first = (
         (None, 1, ('margin-bottom', 'a a'), 1, 0, False, False),
         (None, 1, ('margin', 'a a+1 auto 2*2 1'), 1, 0, False, False),
         (None, 1, ('margin', 'not_defined_var'), 1, 0, False, False),
     )
     for first in first:
         with self.assertRaises(NameError):
             _out(evaluate_properties([first]))
示例#2
0
 def test_evaluate_properties(self):
     _locals['a'] = 2
     first = (
         (None, 1, ('margin-bottom', 'a*2'), 1, 0, False, False),
         (None, 1, ('margin', 'a a+1 auto 2*2'), 1, 0, False, False),
         (None, 1, ('margin', 'a a+1'), 1, 0, False, False),
         (None, 1, ('margin', 'a'), 1, 0, False, False),
     )
     second = (
         (('margin-bottom', '4'), 1, 0, False, False),
         (('margin', '2 3 auto 4'), 1, 0, False, False),
         (('margin', '2 3'), 1, 0, False, False),
         (('margin', '2'), 1, 0, False, False),
     )
     for first, second in zip(first, second):
         first = list(evaluate_properties([first]))
         self.assertEqual(first, [second])