示例#1
0
def test_switch_log_delete(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_switch_delete_existant_switch(api_client)

    assert logs_contains(caplog, 'switch_delete',
                         admin=TESTING_CLIENT,
                         switch_id=1)
示例#2
0
def test_switch_log_create(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_switch_post_valid(api_client)

    log = 'TestingClient created a switch'
    assert logs_contains(caplog, 'switch_create',
                         admin=TESTING_CLIENT)
示例#3
0
def test_device_log_create_wireless(api_client, caplog, wireless_device_dict):
    with caplog.at_level(logging.INFO):
        test_device_put_create_wireless(api_client, wireless_device_dict)

    assert logs_contains(caplog,
                         'device_create',
                         admin=TESTING_CLIENT,
                         mac=wireless_device_dict['mac'])
示例#4
0
def test_room_log_create_room(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_room_put_new_room(api_client)

    assert logs_contains(caplog,
                         'room_create',
                         admin=TESTING_CLIENT,
                         room_number=5111)
示例#5
0
def test_room_log_delete_room(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_room_delete_existant_room(api_client)

    assert logs_contains(caplog,
                         'room_delete',
                         admin=TESTING_CLIENT,
                         room_number=5110)
示例#6
0
def test_device_log_delete_wireless(api_client, caplog, wireless_device,
                                    wireless_device_dict):
    with caplog.at_level(logging.INFO):
        test_device_delete_wireless(api_client, wireless_device)

    assert logs_contains(caplog,
                         'device_delete',
                         admin=TESTING_CLIENT,
                         mac='80-65-F3-FC-44-A9')
示例#7
0
def test_device_log_delete_wired(api_client, caplog, wired_device,
                                 wired_device_dict):
    with caplog.at_level(logging.INFO):
        test_device_delete_wired(api_client, wired_device)

    assert logs_contains(caplog,
                         'device_delete',
                         admin=TESTING_CLIENT,
                         mac='96-24-F6-D0-48-A7')
示例#8
0
def test_port_log_delete_port(api_client, sample_switch1, sample_port1,
                              caplog):
    with caplog.at_level(logging.INFO):
        test_port_delete_port(api_client, sample_switch1, sample_port1)

    assert logs_contains(caplog,
                         'port_delete',
                         admin=TESTING_CLIENT,
                         port_id=sample_port1.id)
示例#9
0
def test_member_log_create(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_member_put_member_create(api_client)

    assert logs_contains(
        caplog,
        'member_create',
        admin=TESTING_CLIENT,
        username='******',
    )
示例#10
0
def test_member_log_get_logs(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_member_get_logs(api_client)

    assert logs_contains(
        caplog,
        'member_get_logs',
        admin=TESTING_CLIENT,
        username='******',
    )
示例#11
0
def test_member_log_update_password(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_member_change_password_ok(api_client)

    assert logs_contains(
        caplog,
        'member_password_update',
        admin=TESTING_CLIENT,
        username='******',
    )
示例#12
0
def test_member_log_add_membership(api_client, caplog):
    with caplog.at_level(logging.INFO):
        test_member_post_add_membership_ok(api_client)

    assert logs_contains(
        caplog,
        'create_membership_record',
        admin=TESTING_CLIENT,
        username='******',
        duration_in_days=360,
        start_date='2000-01-23T04:56:07+00:00',
    )
示例#13
0
def test_port_log_create_port(api_client, sample_switch1, caplog):
    with caplog.at_level(logging.INFO):
        test_port_post_create_port(api_client, sample_switch1)

    assert logs_contains(caplog, 'port_create', admin=TESTING_CLIENT)