def testInvalidColumnAlignmentsLength(self):
        t = TableGenerator.createTableWithDefaultContainer(7, 7)
        defaultAlignments = [Table.ALIGN_LEFT, Table.ALIGN_LEFT,
                Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT,
                Table.ALIGN_LEFT, Table.ALIGN_LEFT]

        try:
            t.setColumnAlignments([Table.ALIGN_LEFT])
            self.fail('No exception thrown for invalid array length')
        except ValueError:
            pass  # Ok, expected

        self.assertEquals(defaultAlignments, t.getColumnAlignments(),
                'Invalid change affected alignments')

        try:
            t.setColumnAlignments([])
            self.fail('No exception thrown for invalid array length')
        except ValueError:
            pass  # Ok, expected

        self.assertEquals(defaultAlignments, t.getColumnAlignments(),
                'Invalid change affected alignments')

        try:
            t.setColumnAlignments([Table.ALIGN_LEFT, Table.ALIGN_LEFT,
                    Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT,
                    Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT])
            self.fail('No exception thrown for invalid array length')
        except __HOLE__:
            pass  # Ok, expected

        self.assertEquals(defaultAlignments, t.getColumnAlignments(),
                'Invalid change affected alignments')
dataset/ETHPy150Open rwl/muntjac/muntjac/test/server/component/table/table_column_alignments.py/TableColumnAlignments.testInvalidColumnAlignmentsLength