コード例 #1
0
 def test_remove_unused_strings(self):
     strings = ('', 'hei', 'hoi')
     model = (1, StringIndex(0), 42, StringIndex(2), -1, None)
     model, strings = _KeywordRemover().remove_unused_strings(
         model, strings)
     assert_equals(strings, ('', 'hoi'))
     assert_equals(model, (1, 0, 42, 1, -1, None))
コード例 #2
0
 def test_remove_unused_strings_nested(self):
     strings = tuple(' abcde')
     model = (StringIndex(0), StringIndex(1), 2, 3, StringIndex(4), 5,
              (0, StringIndex(1), 2, StringIndex(3), 4, 5))
     model, strings = _KeywordRemover().remove_unused_strings(model, strings)
     assert_equals(strings, tuple(' acd'))
     assert_equals(model, (0, 1, 2, 3, 3, 5, (0, 1, 2, 2, 4, 5)))
コード例 #3
0
 def test_remove_unused_strings_nested(self):
     strings = tuple(' abcde')
     model = (StringIndex(0), StringIndex(1), 2, 3, StringIndex(4), 5,
              (0, StringIndex(1), 2, StringIndex(3), 4, 5))
     model, strings = _KeywordRemover().remove_unused_strings(
         model, strings)
     assert_equals(strings, tuple(' acd'))
     assert_equals(model, (0, 1, 2, 3, 3, 5, (0, 1, 2, 2, 4, 5)))
コード例 #4
0
 def test_remove_keywords(self):
     model = self._create_suite_model()
     expected = self._get_expected_suite_model(model)
     result = _KeywordRemover().remove_keywords(model)
     assert_equals(result, expected)
     self._verify_model_contains_no_keywords(result)
コード例 #5
0
 def test_remove_unused_strings(self):
     strings = ('', 'hei', 'hoi')
     model = (1, StringIndex(0), 42, StringIndex(2), -1, None)
     model, strings = _KeywordRemover().remove_unused_strings(model, strings)
     assert_equals(strings, ('', 'hoi'))
     assert_equals(model, (1, 0, 42, 1, -1, None))
コード例 #6
0
 def test_remove_keywords(self):
     model = self._create_suite_model()
     expected = self._get_expected_suite_model(model)
     result = _KeywordRemover().remove_keywords(model)
     assert_equals(result, expected)
     self._verify_model_contains_no_keywords(result)