Revision: 3817
Author: jussi.ao.malinen
Date: Thu Jul 22 04:36:26 2010
Log: As part of issue 576:

1) No pipes between comment cells (point 5)
2) Strip comment values (point 6)


http://code.google.com/p/robotframework/source/detail?r=3817

Modified:
 /trunk/src/robot/parsing/tablepopulators.py
 /trunk/utest/parsing/test_populator.py

=======================================
--- /trunk/src/robot/parsing/tablepopulators.py Wed Jun  9 04:26:40 2010
+++ /trunk/src/robot/parsing/tablepopulators.py Thu Jul 22 04:36:26 2010
@@ -205,7 +205,8 @@
             self._crows.append(row.comments)

     def formatted_value(self):
-        return '\n'.join(' | '.join(row) for row in self._crows)
+        rows = (' '.join(row).strip() for row in self._crows)
+        return '\n'.join(rows)


 class _PropertyPopulator(Populator):
=======================================
--- /trunk/utest/parsing/test_populator.py      Wed Jun  9 04:26:40 2010
+++ /trunk/utest/parsing/test_populator.py      Thu Jul 22 04:36:26 2010
@@ -416,9 +416,9 @@
         self._assert_no_parsing_errors()
         self._assert_setting('force_tags', ['Foo', 'Bar'], 'comment')
         self._assert_import(0, 'Foo', [], 'Lib comment')
- self._assert_import(1, 'resource2.txt', [], 'Resource | resource.txt') - self._assert_setting('default_tags', ['Quux'], 'comment | between rows | in many cells\nalso end of line')
-        self._assert_import(2, 'varz.py', ['arg'], ' between values')
+ self._assert_import(1, 'resource2.txt', [], 'Resource resource.txt') + self._assert_setting('default_tags', ['Quux'], 'comment between rows in many cells\nalso end of line')
+        self._assert_import(2, 'varz.py', ['arg'], 'between values')
self._assert_meta(0, 'metaname', 'metavalue', 'last line is commented')

     def test_variable_table(self):
@@ -430,7 +430,7 @@
                                          ['...', 'otherval'],
                                          ['#EOT']])
         self._assert_variable(0, '${varname}', ['varvalue'], 'has comment')
- self._assert_variable(1, '@{items}', ['1', '2', '3'], 'label | A | B | C') + self._assert_variable(1, '@{items}', ['1', '2', '3'], 'label A B C') self._assert_variable(2, '${ohtervarname}', ['otherval'], '#end comment\ncomment\nEOT')

     def test_test_case_table(self):
@@ -446,18 +446,18 @@
                                           ['',':FOR', 'v*ttuperkele'],
                                           ['#commented out in for loop'],
['','', 'Fooness in the bar', '#end commtne'],
-                                          ['','#', 'Barness'],
+                                          ['','# ', '   Barness  '],
                                           ['', 'Lodi']
                                           ])
assert_equals(self._first_test().steps[0].comment, 'start of table comment')
         assert_equals(self._first_test().steps[1].comment, 'step comment')
assert_equals(self._first_test().steps[2].comment, 'This step has only comment') assert_equals(self._nth_test(2).steps[0].comment, 'comment in name row') - assert_equals(self._nth_test(2).steps[1].comment, ' | Comment between step def') + assert_equals(self._nth_test(2).steps[1].comment, 'Comment between step def')
         assert_equals(self._nth_test(2).steps[1].args, ['argh', 'urgh'])
assert_equals(self._nth_test(3).steps[0].steps[0].comment, 'commented out in for loop') assert_equals(self._nth_test(3).steps[0].steps[1].comment, 'end commtne')
-        assert_equals(self._nth_test(3).steps[1].comment, ' | Barness')
+        assert_equals(self._nth_test(3).steps[1].comment, 'Barness')
         self._number_of_steps_should_be(self._nth_test(3), 3)


Reply via email to