Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
def __eq__(self, other):
if not isinstance(other, Modification):
return NotImplemented
elif self is other:
return True
else:
return self.__dict__ == other.__dict__