Default column name in OR 2.5 is "Column 1"
This commit is contained in:
parent
08dd425f28
commit
1a5f7c482d
|
@ -283,8 +283,8 @@ class TutorialTestTransposeColumnsIntoRows(refinetest.RefineTestCase):
|
||||||
class TutorialTestTransposeFixedNumberOfRowsIntoColumns(
|
class TutorialTestTransposeFixedNumberOfRowsIntoColumns(
|
||||||
refinetest.RefineTestCase):
|
refinetest.RefineTestCase):
|
||||||
project_file = 'fixed-rows.csv'
|
project_file = 'fixed-rows.csv'
|
||||||
project_file_options = {'split_into_columns': False,
|
project_format = 'text/line-based'
|
||||||
'header_lines': 0}
|
project_options = {'header_lines': 0}
|
||||||
|
|
||||||
def test_transpose_fixed_number_of_rows_into_columns(self):
|
def test_transpose_fixed_number_of_rows_into_columns(self):
|
||||||
# Section "5. Structural Editing,
|
# Section "5. Structural Editing,
|
||||||
|
@ -351,14 +351,15 @@ class TutorialTestTransposeFixedNumberOfRowsIntoColumns(
|
||||||
class TutorialTestTransposeVariableNumberOfRowsIntoColumns(
|
class TutorialTestTransposeVariableNumberOfRowsIntoColumns(
|
||||||
refinetest.RefineTestCase):
|
refinetest.RefineTestCase):
|
||||||
project_file = 'variable-rows.csv'
|
project_file = 'variable-rows.csv'
|
||||||
project_file_options = {'split_into_columns': False,
|
project_format = 'text/line-based'
|
||||||
'header_lines': 0}
|
project_options = {'header_lines': 0}
|
||||||
|
|
||||||
def test_transpose_variable_number_of_rows_into_columns(self):
|
def test_transpose_variable_number_of_rows_into_columns(self):
|
||||||
# {20}, {21}
|
# {20}, {21}
|
||||||
|
column_name = 'Column 1' if self.server.version == '2.5' else 'Column'
|
||||||
self.project.add_column(
|
self.project.add_column(
|
||||||
'Column', 'First Line', 'if(value.contains(" on "), value, null)')
|
column_name, 'First Line', 'if(value.contains(" on "), value, null)')
|
||||||
self.assertInResponse('Column by filling 4 rows')
|
self.assertInResponse(column_name + ' by filling 4 rows')
|
||||||
response = self.project.get_rows()
|
response = self.project.get_rows()
|
||||||
first_names = [row['First Line'][0:10] if row['First Line'] else None
|
first_names = [row['First Line'][0:10] if row['First Line'] else None
|
||||||
for row in response.rows]
|
for row in response.rows]
|
||||||
|
@ -376,11 +377,11 @@ class TutorialTestTransposeVariableNumberOfRowsIntoColumns(
|
||||||
self.assertEqual(response.filtered, 4)
|
self.assertEqual(response.filtered, 4)
|
||||||
# {24}
|
# {24}
|
||||||
self.project.add_column(
|
self.project.add_column(
|
||||||
'Column', 'Status', 'row.record.cells["Column"].value[-1]')
|
column_name, 'Status', 'row.record.cells["' + column_name + '"].value[-1]')
|
||||||
self.assertInResponse('filling 18 rows')
|
self.assertInResponse('filling 18 rows')
|
||||||
# {25}
|
# {25}
|
||||||
self.project.text_transform(
|
self.project.text_transform(
|
||||||
'Column', 'row.record.cells["Column"].value[1, -1].join("|")')
|
column_name, 'row.record.cells["' + column_name + '"].value[1, -1].join("|")')
|
||||||
self.assertInResponse('18 cells')
|
self.assertInResponse('18 cells')
|
||||||
# {26}
|
# {26}
|
||||||
self.project.engine.mode = 'row-based'
|
self.project.engine.mode = 'row-based'
|
||||||
|
@ -390,8 +391,8 @@ class TutorialTestTransposeVariableNumberOfRowsIntoColumns(
|
||||||
self.assertInResponse('Remove 14 rows')
|
self.assertInResponse('Remove 14 rows')
|
||||||
self.project.engine.remove_all()
|
self.project.engine.remove_all()
|
||||||
# {28}
|
# {28}
|
||||||
self.project.split_column('Column', separator='|')
|
self.project.split_column(column_name, separator='|')
|
||||||
self.assertInResponse('Split 4 cell(s) in column Column')
|
self.assertInResponse('Split 4 cell(s) in column ' + column_name)
|
||||||
|
|
||||||
|
|
||||||
class TutorialTestWebScraping(refinetest.RefineTestCase):
|
class TutorialTestWebScraping(refinetest.RefineTestCase):
|
||||||
|
|
Loading…
Reference in New Issue