How to use the pydriller.domain.modification.Modification function in PyDriller

To help you get started, we’ve selected a few PyDriller examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ishepard / pydriller / tests / test_modification.py View on Github external
def test_should_get_name_of_file_even_when_deleted():
    m1 = Modification("/a/b/Class.java", "/dev/null", ModificationType.DELETE, "bla bla", "bla bla");
    assert "Class.java" == m1.filename

    m2 = Modification("/a/b/Class.java", "/a/b/Class.java", ModificationType.MODIFY, "bla bla", "bla bla");
    assert "Class.java" == m2.filename

    m3 = Modification("/dev/null", "/a/b/Class.java", ModificationType.ADD, "bla bla", "bla bla");
    assert "Class.java" == m3.filename
github ishepard / pydriller / tests / test_modification.py View on Github external
def test_should_get_name_of_file_even_when_deleted():
    m1 = Modification("/a/b/Class.java", "/dev/null", ModificationType.DELETE, "bla bla", "bla bla");
    assert "Class.java" == m1.filename

    m2 = Modification("/a/b/Class.java", "/a/b/Class.java", ModificationType.MODIFY, "bla bla", "bla bla");
    assert "Class.java" == m2.filename

    m3 = Modification("/dev/null", "/a/b/Class.java", ModificationType.ADD, "bla bla", "bla bla");
    assert "Class.java" == m3.filename
github ishepard / pydriller / pydriller / domain / modification.py View on Github external
def __eq__(self, other):
        if not isinstance(other, Modification):
            return NotImplemented
        elif self is other:
            return True
        else:
            return self.__dict__ == other.__dict__