Example #1
0
 def test_equal(self):
     target_file = 'Triangle.java'
     ingr_file = 'Triangle.java'
     target = (target_file, 1)
     ingredient = (ingr_file, 2)
     line_replacement = LineReplacement(target, ingredient)
     line_replacement2 = LineReplacement(target, ingredient)
     line_replacement3 = LineReplacement(target, target)
     line_insertion = LineInsertion(target, ingredient)
     assert line_replacement is not line_replacement2
     assert line_replacement == line_replacement2
     assert line_replacement != line_replacement3
     assert line_insertion != line_replacement
Example #2
0
    def test_create(self, setup_lineprogram):
        program = setup_lineprogram
        random_line_replacement = LineReplacement.create(
            program, target_file='Triangle.java', ingr_file='Triangle.java')

        assert isinstance(random_line_replacement, LineReplacement)
        assert random_line_replacement.data is not None
Example #3
0
        def test_create(self):
            program = LineProgram('../sample/Triangle_bug_java')
            random_line_replacement = LineReplacement.create(
                program,
                target_file='Triangle.java',
                ingr_file='Triangle.java')

            assert isinstance(random_line_replacement, LineReplacement)
            assert random_line_replacement.ingredient is not None
Example #4
0
def setup_line_replacement():
    target_file = 'Triangle.java'
    ingr_file = 'Triangle.java'
    target = (target_file, 1)
    ingredient = (ingr_file, 2)
    return LineReplacement(target, ingredient), target, ingredient