Commits

Jonathan Fine committed f05ddbd Draft

Fix the trailing comma inconsistency in example_template_function.py.

Comments (0)

Files changed (2)

py2/jfine/example_template_function.py

         if False:
             pass
         elif flag == 1:
-            a, b = fn(locs)
+            a, b, = fn(locs)
             extend((
                     'A',
                     a,
                     'a',
                     ))
         elif flag == 3:
-            a, c = fn(locs)
+            a, c, = fn(locs)
             extend((
                     'b',
                     b,

py2/jfine/work.py

 if __name__ == '__main__':
 
     a_z = dict(zip(range(10), 'abcdefghij'))
-    b = Block((0, 1, 2), (3, 4, 'Hello'))
-    for pair in b.iter_pairs(1, a_z):
-        print pair
 
     BLOCKS = (
         Block((0, 1), ('A', 0, 1, 'C', 2)),
 
     generated_pairs = tuple(tmp)
 
-    pairs = (
+    manual_pairs = (
         ('HEADER', None),
         ('IF', 1),
-        ('BEGIN', 'a, b'),
+        ('BEGIN', 'a, b,'),
         ('STRING', 'A'),
         ('VAR', 'a'),
         ('VAR', 'b'),
         ('STRING', 'a'),
         ('END', None),
         ('IF', 3),
-        ('BEGIN', 'a, c'),
+        ('BEGIN', 'a, c,'),
         ('STRING', 'b'),
         ('VAR', 'b'),
         ('END', None),
         )
 
-    for a, b in zip(generated_pairs, pairs):
-        if a != b:
-            print a, b
-
+    assert generated_pairs == manual_pairs
 
     filename = 'py2/jfine/example_template_function.py'
     with open(filename, 'rb') as f:
         expect = f.read()
 
-    actual = doit(pairs)
+    actual = doit(manual_pairs)
 
     assert expect == actual