tickets.tests package

Submodules

tickets.tests.tests_connectors module

class tickets.tests.tests_connectors.TestAlarmConnector(methodName='runTest')

Bases: django.test.testcases.TestCase

This class defines the test suite for the Alarms Connector

test_acknowledge_alarms(IAlarms_acknowledge_alarms)

Test that AlarmConnector.acknowledge_alarms calls IAlarms.acknowledge_alarms

test_get_alarm_ancestors(IAlarms_get_alarm_ancestors)

Test that AlarmConnector.get_alarm_ancestors calls IAlarms.get_alarm_ancestors

test_get_alarm_dependencies(IAlarms_get_alarm_dependencies)

Test that AlarmConnector.get_alarm_dependencies calls IAlarms.get_alarm_dependencies

test_shelve_alarm(IAlarms_shelve_alarm)

Test that AlarmConnector.shelve_alarm calls IAlarms.shelve_alarm

test_unshelve_alarms(IAlarms_unshelve_alarms)

Test that AlarmConnector.unshelve_alarms calls IAlarms.unshelve_alarms

tickets.tests.tests_shelves_api module

class tickets.tests.tests_shelves_api.APITestBase

Bases: object

authenticate_client_using_token(client, token)

Authenticates a selected API Client using a related User token

create_user(**kwargs)

Creates a user with selected permissions

class tickets.tests.tests_shelves_api.ApiCanCheckTimeouts(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_check_timeouts_for_an_unauthenticated_client(AlarmConnector_unshelve_alarms)

Test that the api can check if active registries have timed out and notify accordingly for an authenticated user

class tickets.tests.tests_shelves_api.CreateRegistry(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

Test suite to test the create request

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_can_create_registry(AlarmConnector_shelve_alarm)

Test that the api can create a registry

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.CreateRegistryAndAlreadyShelvedAlarm(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

test_api_cannot_create_registry_for_already_shelved_alarm(AlarmConnector_shelve_alarm)

Test that the api cannot create a registry to an already shelved alarm for an authorized user

class tickets.tests.tests_shelves_api.CreateRegistryAndNoShelvableAlarm(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

test_api_cannot_create_registry_for_non_shelvable_alarm(AlarmConnector_shelve_alarm)

Test that the api cannot create a registry to a non shelvable alarm for an authorized user

class tickets.tests.tests_shelves_api.CreateRegistryWithNoMessageCase(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

Test suite to test the create request

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_can_create_registry(AlarmConnector_shelve_alarm, AlarmConnector_unshelve_alarms)

Test that the api cannot create a registry without a message for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.DeleteRegistry(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_delete_a_registry()

Test that the api can delete a registry for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.FilterRegistryForAlarmAndShelvedCase(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_can_filter_registries_by_alarms_and_shelve_status()

Tets that the api can list the ShelveRegistrys filtered by alarm and shelved status for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.FilterRegistryForAlarmAndUnshelvedCase(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_can_filter_registries_by_alarm_and_unshelved_status()

Tets that the api can list the ShelveRegistrys filtered by alarm and unshelved status for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.FilterRegistryForShelvedCase(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_can_filter_all_shelved_registries()

Test that the api can filter ShelveRegistrys only by shelved status for an authenticated user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.FilterRegistryForUnshelvedCase(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

target_request_from_client(client)
test_api_can_filter_all_open_registries()

Test that the api can filter ShelveRegistrys by unshelved status for an authenticated user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.ListRegistry(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_list_registries()

Test that the api can list the ShelveRegistries for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.RetrieveRegistry(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_retreive_registry_to_authorized_user()

Test that the api should retrieve a ticket for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.ShelveRegistryTestSetup

Bases: object

Class to manage the common setup for testing.

setupCommonUsersAndClients()

Add unauthenticated and unauthorized users

class tickets.tests.tests_shelves_api.UnshelveMultipleRegistries(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_unshelve_multiple_registries(AlarmConnector_unshelve_alarms)

Test that the api can unshelve multiple ununshelved registries for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.UpdateRegistry(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_update_registry()

Test that the api can update a registry for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_shelves_api.UpdateRegistryWithoutMessage(methodName='runTest')

Bases: tickets.tests.tests_shelves_api.APITestBase, tickets.tests.tests_shelves_api.ShelveRegistryTestSetup, django.test.testcases.TestCase

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

test_api_cannot_update_registry_to_have_no_message()

Test that the api cannot update a registry and leave it without a message for an authorized user

tickets.tests.tests_shelves_models module

class tickets.tests.tests_shelves_models.ShelveRegistryModelsTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

This class defines the test suite for the ShelveRegistry model tests

setUp()

Hook method for setting up the test fixture before exercising it.

test_cannot_create_registry_with_no_message()

Test if we cannot create a shelve_registry without a message

test_create_registry()

Test if we can create a shelve_registry

test_unshelve_a_registry()

Test if we can unshelve an alarm

tickets.tests.tests_tickets_api module

class tickets.tests.tests_tickets_api.APITestBase

Bases: object

authenticate_client_using_token(client, token)

Authenticates a selected API Client using a related User token

create_user(**kwargs)

Creates a user with selected permissions

class tickets.tests.tests_tickets_api.AcknowledgeAllTicketsByAlarm(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the acknowledge request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_acknowledge_all_tickets_by_alarm(AlarmConnector_acknowledge_alarms)

Test that the api can ack unacknowledged tickets and cleared unacknowledged tickets for an alarm for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.AcknowledgeMultipleTickets(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the acknowledge request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_acknowledge_multiple_tickets(AlarmConnector_acknowledge_alarms)

Test that the api can acknowledge multiple unacknowledged tickets for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.AcknowledgeMultipleTicketsAndDependencies(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the acknowledge request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_acknowledge_multiple_tickets_with_dependencies(AlarmConnector_acknowledge_alarms)

Test that the api can acknowledge multiple unacknowledged tickets and their dependencies for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.AcknowledgeTicketsRequestAndNoMessage(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the acknowledge request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_not_acknowledge_tickets_by_alarm_without_message(AlarmConnector_acknowledge_alarms)

Test that the api can not ack an unacknowledged ticket with an empty message for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.CreateTicketTestCase(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, django.test.testcases.TestCase

Test suite to test the creation permissions of tickets using the api.

setUp()

Define the test suite setup.

target_request_from_client(client)
test_api_cannot_create_tickets_for_an_authenticated_user()

Test that an authenticated user can not use the request

test_api_cannot_create_tickets_for_an_unauthenticated_user()

Test that an unauthenticated user can not use the request

test_api_should_always_unallow_the_create_permission()

Should not be allowed to add tickets using the api

test_ticket_should_not_have_and_add_default_permission()

Should not be permissions to add tickets using the api

test_unavailable_add_ticket_permission_for_the_users()

Should not be permissions for the users

class tickets.tests.tests_tickets_api.FilterTicketsByAlarm(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the retrieve request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_filter_tickets_by_alarm()

Test that the api can list the Tickets filtered by alarm id only for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.FilterTicketsByAlarmAndStatus(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the retrieve request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_filter_tickets_by_alarm_and_status()

Test that the api can list the Tickets filtered by alarm id and status only for an autorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.FilterTicketsByStatus(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the retrieve request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_filter_tickets_by_status()

Test that the api can list the Tickets filtered by status only for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.ListTicket(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the list request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_list_tickets_to_authorized_user()

Test that the api can list the Tickets to an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.RetrieveOldOpenTickets(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the retrieve request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_retrieve_old_open_tickets_information(AlarmConnector_get_alarm_dependencies)

Test that the api can retrieve cleared unack tickets information of an specified alarm

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.RetrieveTicket(methodName='runTest')

Bases: tickets.tests.tests_tickets_api.APITestBase, tickets.tests.tests_tickets_api.TicketsTestSetup, django.test.testcases.TestCase

Test suite to test the retrieve request

setUp()

Define the test suite setup

target_request_from_client(client)
test_api_can_retrieve_tickets_to_authorized_user()

The api should retrieve a ticket for an authorized user

test_api_cannot_allow_request_for_unauthenticated_user()

The request should not be allowed for an unauthenticated user

test_api_cannot_allow_request_for_unauthorized_user()

The request should not be allowed for an unauthorized user

class tickets.tests.tests_tickets_api.TicketsTestSetup

Bases: object

Class to manage the common setup for testing.

setTestTicketsConfig()
setupCommonUsersAndClients()

Add unauthenticated and unauthorized users

tickets.tests.tests_tickets_models module

class tickets.tests.tests_tickets_models.TicketsModelsTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

This class defines the test suite for the Tickets model tests

test_acknowledge_a_ticket()

Test if we can acknowledge a ticket passing it a valid message

test_create_ticket()

Test if we can create a ticket

Module contents