Commits

Jonathan Fine  committed 48f2c74 Draft

Add automated comparison of actual and expected template function.

  • Participants
  • Parent commits 0dcf37d
  • Branches jfine.2012-11-18

Comments (0)

Files changed (1)

File py2/jfine/work.py

         for key, value in pairs
 )
 
+if __name__ == '__main__':
 
-print doit((
+    pairs = (
         ('HEADER', None),
         ('IF', 1),
         ('BEGIN', 'a, b'),
         ('STRING', 'b'),
         ('VAR', 'b'),
         ('END', None),
-)),                             # No new line.
+        )
 
+    filename = 'py2/jfine/example_template_function.py'
+    with open(filename, 'rb') as f:
+        expect = f.read()
 
+    actual = doit(pairs)
 
+    assert expect == actual
+