Unverified Commit df737679 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

tests: embed test fixture in the code



This is to make it easier to mangle the fixture at runtime.

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 7bf04a62
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -50,9 +50,13 @@ def set2(gzip2, bzip2, xz2):


def expected_magic_diff(ext1, ext2):
    meta1 = get_data("containers/magic_%s" % ext1)
    meta2 = get_data("containers/magic_%s" % ext2)
    return "@@ -1 +1 @@\n" + "-" + meta1 + "+" + meta2
    magic = {
        "bzip2": "bzip2 compressed data, block size = 900k\n",
        "gzip": "gzip compressed data, last modified: Sun Sep 10 22:19:44 2017, from Unix\n",
        "xz": "XZ compressed data\n",
    }

    return "@@ -1 +1 @@\n" + "-" + magic[ext1] + "+" + magic[ext2]


def expected_type_diff(ext1, ext2):

tests/data/containers/magic_bzip2

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
bzip2 compressed data, block size = 900k

tests/data/containers/magic_gzip

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
gzip compressed data, last modified: Sun Sep 10 22:19:44 2017, from Unix

tests/data/containers/magic_xz

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
XZ compressed data