Revision: 467a92eafd5f
Author:   Janne Härkönen <[email protected]>
Date:     Thu Dec 22 01:27:59 2011
Log:      writer: write empty rows between tests and keywords
http://code.google.com/p/robotframework/source/detail?r=467a92eafd5f

Modified:
 /src/robot/writer/tableformatters.py
 /utest/writer/golden.py

=======================================
--- /src/robot/writer/tableformatters.py        Tue Dec 20 05:00:36 2011
+++ /src/robot/writer/tableformatters.py        Thu Dec 22 01:27:59 2011
@@ -24,10 +24,13 @@
         return self._rows_from_item(item, indent)

     def _rows_from_indented_table(self, table):
-        for item in table:
+        items = list(table)
+        for index, item in enumerate(items):
             yield self._format_name(item)
             for row in self._rows_from_item(item, 1):
                 yield row
+            if index < len(items) -1:
+                yield []

     def _rows_from_item(self, item, indent=0):
         for child in (c for c in item if c.is_set()):
@@ -105,7 +108,8 @@
         return result

     def format_indented_table(self, table):
-        for item in table:
+        items = list(table)
+        for i, item in enumerate(items):
             rows = list(self._rows_from_item(item, 1))
             if len(item.name) > self._max_name_length:
                 yield [item.name]
@@ -115,6 +119,8 @@
                 rows = rows[1:]
             for r in rows:
                 yield self.align_row(r)
+            if i < len(items) - 1:
+                yield []

     def _format_model_item(self, item, indent):
         return [self._escape(['']*indent + item.as_list())]
@@ -128,11 +134,14 @@
 class SplittingHtmlFormatter(RowSplittingFormatter):

     def format_indented_table(self, table):
-        for item in table:
+        items = list(table)
+        for i, item in enumerate(items):
             rows = list(self._rows_from_item(item, 1))
             yield self._first_row(item, rows[0])
             for row in rows[1:]:
                 yield row
+            if i < len(items) - 1:
+                yield self._pad([NameCell()])

     def _first_row(self, item, row):
         return [self._format_name(item)] + row[1:]
=======================================
--- /utest/writer/golden.py     Tue Dec 20 04:11:40 2011
+++ /utest/writer/golden.py     Thu Dec 22 01:27:59 2011
@@ -33,6 +33,9 @@
     My TC Step 1    my step arg    # step 1 comment
     My TC Step 2    my step 2 arg    second \ arg    # step 2 comment
     [Teardown]    1 minute    args
+
+Another Test
+    No Operation
 '''
 GOLDEN_ALIGNED_TXT_TESTCASE_FILE = _txt_template % '''
 *** Test Cases ***    header1            header2
@@ -40,9 +43,11 @@
My TC Step 1 my step arg # step 1 comment My TC Step 2 my step \ 2 arg second arg # step 2 comment
                       [Teardown]         1 minute
+
 A very long named test case
                       My step 1          This is arg
                       My step 2          This also is arg
+
Test with for : FOR ${i} IN RANGE 100 \ Log ${i}
 '''
@@ -82,6 +87,9 @@
 |    | My TC Step 1 | my step arg | # step 1 comment |
 |    | My TC Step 2 | my step 2 arg | second \ arg | # step 2 comment |
 |    | [Teardown] | 1 minute | args |
+
+| Another Test |
+|    | No Operation |
 '''

 _tsv_template = '''*Settings*\t\t\t\t\t\t\t
@@ -119,6 +127,9 @@
 \tMy TC Step 1\tmy step arg\t# step 1 comment\t\t\t\t
 \tMy TC Step 2\tmy step 2 arg\tsecond \ arg\t# step 2 comment\t\t\t
 \t[Teardown]\t1 minute\targs\t\t\t\t
+\t\t\t\t\t\t\t
+Another Test\t\t\t\t\t\t\t
+\tNo Operation\t\t\t\t\t\t
 \t\t\t\t\t\t\t'''

 GOLDEN_HTML_TESTCASE_FILE = '''\
@@ -298,6 +309,20 @@
 <td></td>
 </tr>
 <tr>
+<td class="name"></td>
+<td></td>
+<td></td>
+<td></td>
+<td></td>
+</tr>
+<tr>
+<td class="name"><a name="test_Another Test">Another Test</a></td>
+<td>No Operation</td>
+<td></td>
+<td></td>
+<td></td>
+</tr>
+<tr>
 <td class="name"></td>
 <td></td>
 <td></td>

Reply via email to