Beispiel #1
0
def test_patch_separation_ignore():
    c = Commit()
    c._patch = PATCH_SEPARATION
    file_to_ignore = ".env"
    c.filter_set = {os.path.join(os.getcwd(), file_to_ignore)}
    files = list(c.get_files())

    assert len(files) == 3
    assert not (any(entry.filename == file_to_ignore for entry in files))
Beispiel #2
0
def test_patch_separation():
    c = Commit()
    c._patch = PATCH_SEPARATION
    files = list(c.get_files())

    assert len(files) == 4

    assert c.info.author == "Testificate Jose"
    assert c.info.email == "*****@*****.**"
    assert c.info.date == "Fri Oct 18 13:20:00 2012 +0100"
Beispiel #3
0
def test_patch_max_size():
    c = Commit()
    c._patch = """
diff --git a/tests/test_scannable.py b/.env
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/.env
@@ -0,0 +1,112 @@
CHECK_ENVIRONMENT=true
    """
    c._patch += "a" * MAX_FILE_SIZE
    files = list(c.get_files())

    assert len(files) == 0