def test_as_tuples(self):
        initial_list = [
            (1, Trigger.POSA_GT, 100, 3000, 1, 0, 0, 0, 0, 0, 2700, 0, 0, 0, 0,
             0, 0),
            (3, Trigger.BITA_0, 300, 2000, 0, 1, 0, 0, 0, 0, 1900, 0, 0, 0, 0,
             0, 0),
        ]
        seq_rows = SequencerRows.from_tuple_list(initial_list)

        expected = tuple(initial_list)
        assert seq_rows.as_tuples() == expected
    def test_get_table(self):
        initial_list = [
            (1, Trigger.POSA_GT, 100, 3000, 1, 0, 0, 0, 0, 0, 2700, 0, 0, 0, 0,
             0, 0),
            (3, Trigger.BITA_0, 300, 2000, 0, 1, 0, 0, 0, 0, 1900, 0, 0, 0, 0,
             0, 0),
        ]

        total_ticks = (3000 + 2700) + 3 * (2000 + 1900)

        seq_rows = SequencerRows.from_tuple_list(initial_list)
        seq_rows.add_seq_entry()
        seq_rows.add_seq_entry(4, Trigger.POSA_GT, 400, 1000, 0, 1, 50)
        seq_rows.add_seq_entry((2 * MAX_REPEATS) + 20, Trigger.BITA_0, 300,
                               200, 1, 0, 100)

        total_ticks += ((MIN_PULSE * 2) + (4 * (1000 + 950)) +
                        (2 * MAX_REPEATS + 20) * (200 + 100))
        assert isclose(seq_rows.duration, total_ticks * TICK)
        assert len(seq_rows) == 7

        table = seq_rows.get_table()
        GT = Trigger.POSA_GT
        IT = Trigger.IMMEDIATE
        B0 = Trigger.BITA_0
        assert table.repeats == [1, 3, 1, 4, MAX_REPEATS, MAX_REPEATS, 20]
        assert table.trigger == [GT, B0, IT, GT, B0, B0, B0]
        assert table.position == [100, 300, 0, 400, 300, 300, 300]
        assert table.time1 == [3000, 2000, MIN_PULSE, 1000, 200, 200, 200]
        assert table.outa1 == [1, 0, 0, 0, 1, 1, 1]  # Live
        assert table.outb1 == [0, 1, 0, 1, 0, 0, 0]  # Dead
        assert (table.outc1 == table.outd1 == table.oute1 == table.outf1 ==
                [0, 0, 0, 0, 0, 0, 0])
        assert table.time2 == [2700, 1900, MIN_PULSE, 950, 100, 100, 100]
        assert (table.outa2 == table.outb2 == table.outc2 == table.outd2 ==
                table.oute2 == table.outf2 == [0, 0, 0, 0, 0, 0, 0])