#
# Copyright (C) 2015 Satoru SATOH <ssato at redhat.com>
#
import os.path
import tempfile


def selfdir():
    return os.path.dirname(__file__)


def setup_workdir():
    return tempfile.mkdtemp(dir="/tmp", prefix="python-anytemplate-tests-")


def cleanup_workdir(workdir):
    """
    FIXME: Danger!
    """
    os.system("rm -rf " + workdir)

# vim:sw=4:ts=4:et:

@@ -68,16 +68,31 @@
 os.path%0A
+import difflib%0A
 import t
@@ -355,16 +355,320 @@
 rkdir)%0A%0A
+%0Adef diff(result, exp):%0A    %22%22%22%0A    Print unified diff.%0A%0A    :param result: Result string%0A    :param exp: Expected result string%0A    %22%22%22%0A    diff = difflib.unified_diff(result.splitlines(), exp.splitlines(),%0A                                'Result', 'Expected')%0A    return %22%5Cn'%22 + %22%5Cn%22.join(diff) + %22'%22%0A%0A
 # vim:sw

add an utility function to print diff