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)
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)
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'])
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)
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)
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')
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')
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)
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='******', )
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='******', )
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='******', )
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', )
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)