def test_add(sim_engine, fixture_neighbor_mac_addr):
    sim_engine = sim_engine()  # need for log

    slotframe = SlotFrame(None, 1, 101)
    cell = Cell(0, 0, all_options_on, fixture_neighbor_mac_addr)
    slotframe.add(cell)

    assert slotframe.get_cells_at_asn(0) == [cell]
    assert slotframe.get_cells_at_asn(1) == []
    assert slotframe.get_cells_at_asn(100) == []
    assert slotframe.get_cells_at_asn(101) == [cell]

    assert slotframe.get_cells_by_slot_offset(0) == [cell]
    assert slotframe.get_cells_by_slot_offset(1) == []
    assert slotframe.get_cells_by_slot_offset(100) == []

    assert slotframe.get_cells_by_mac_addr(fixture_neighbor_mac_addr) == [cell]
    assert slotframe.get_cells_by_mac_addr('dummy_mac_addr') == []

    assert ([
        cell
        for cell in slotframe.get_cells_by_mac_addr(fixture_neighbor_mac_addr)
        if cell.options ==
        [d.CELLOPTION_TX, d.CELLOPTION_RX, d.CELLOPTION_SHARED]
    ] == [cell])
def test_add(fixture_neighbor_mac_addr):
    slotframe = SlotFrame(101)
    cell = Cell(0, 0, all_options_on, fixture_neighbor_mac_addr)
    slotframe.add(cell)

    assert slotframe.get_cells_at_asn(0) == [cell]
    assert slotframe.get_cells_at_asn(1) == []
    assert slotframe.get_cells_at_asn(100) == []
    assert slotframe.get_cells_at_asn(101) == [cell]

    assert slotframe.get_cells_by_slot_offset(0) == [cell]
    assert slotframe.get_cells_by_slot_offset(1) == []
    assert slotframe.get_cells_by_slot_offset(100) == []

    assert slotframe.get_cells_by_mac_addr(fixture_neighbor_mac_addr) == [cell]
    assert slotframe.get_cells_by_mac_addr('dummy_mac_addr') == []

    assert (filter(
        lambda cell: cell.options ==
        [d.CELLOPTION_TX, d.CELLOPTION_RX, d.CELLOPTION_SHARED],
        slotframe.get_cells_by_mac_addr(fixture_neighbor_mac_addr)) == [cell])