Example #1
0
 def test_formatter_by_named_column(self):
     """Test one named column"""
     s = NominableSheet(self.data, "test")
     s.name_columns_by_row(0)
     f = NamedColumnFormatter("Column 1", str)
     s.apply_formatter(f)
     assert s.column["Column 1"] == ["1", "4", "7"]
Example #2
0
 def test_formatter_by_named_columns(self):
     """Test multiple named columns"""
     s = NominableSheet(self.data, "test")
     s.name_columns_by_row(0)
     f = NamedColumnFormatter(["Column 1", "Column 3"], str)
     s.apply_formatter(f)
     assert s.column["Column 1"] == ["1", "4", "7"]
     assert s.column["Column 3"] == ["3", "6", "9"]
Example #3
0
 def test_formatter_by_named_row2(self):
     """Test a list of string as index"""
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     f = NamedRowFormatter(["Row 1", "Row 2"], str)
     s.apply_formatter(f)
     assert s.row["Row 1"] == ["1", "2", "3"]
     assert s.row["Row 2"] == ["4", "5", "6"]
Example #4
0
 def test_formatter_by_named_row(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     f = NamedRowFormatter("Row 1", str)
     s.apply_formatter(f)
     assert s.row["Row 1"] == ["1", "2", "3"]