hawat.blueprints.filters.test package

Unit tests for hawat.blueprints.filters.

class hawat.blueprints.filters.test.FilterTestMixin[source]

Bases: object

Mixin class for filter specific tests.

filter_get(filter_name, with_app_context=False)[source]

Get given filter.

filter_id(filter_type, with_app_context=False)[source]

Get ID of given filter.

filter_save(filter_object, with_app_context=False)[source]

Update given filter.

class hawat.blueprints.filters.test.FiltersCreateForTestCase(methodName='runTest')[source]

Bases: FilterTestMixin, TestRunnerMixin, ItemCreateHawatTestCase

Class for testing filters.createfor endpoint.

filter_data_fixture = [('name', 'TEST_FILTER'), ('type', 'basic'), ('description', 'Test filter for unit testing purposes.'), ('filter', 'Category IN ["Recon.Scanning"] AND Target.IP4 IN ["191.168.1.1", "10.0.0.1"]'), ('enabled', True)]
test_01_as_user(*args, **kwargs)
test_02_as_developer(*args, **kwargs)
test_03_as_maintainer(*args, **kwargs)
test_04_as_admin(*args, **kwargs)
class hawat.blueprints.filters.test.FiltersCreateTestCase(methodName='runTest')[source]

Bases: FilterTestMixin, TestRunnerMixin, ItemCreateHawatTestCase

Class for testing filters.create endpoint.

filter_data_fixture = [('name', 'TEST_FILTER'), ('type', 'basic'), ('group', 1), ('description', 'Test filter for unit testing purposes.'), ('filter', 'Category IN ["Recon.Scanning"] AND Target.IP4 IN ["191.168.1.1", "10.0.0.1"]'), ('enabled', True)]
test_01_as_user(*args, **kwargs)
test_02_as_developer(*args, **kwargs)
test_03_as_maintainer(*args, **kwargs)
test_04_as_admin(*args, **kwargs)
class hawat.blueprints.filters.test.FiltersDeleteTestCase(methodName='runTest')[source]

Bases: FilterTestMixin, TestRunnerMixin, HawatTestCase

Class for testing filters.delete endpoint.

test_01_as_user(*args, **kwargs)
test_02_as_developer(*args, **kwargs)
test_03_as_maintainer(*args, **kwargs)
test_04_as_admin(*args, **kwargs)
class hawat.blueprints.filters.test.FiltersEnableDisableTestCase(methodName='runTest')[source]

Bases: FilterTestMixin, TestRunnerMixin, HawatTestCase

Class for testing filters.enable and filters.disable endpoint.

test_01_as_user(*args, **kwargs)
test_02_as_developer(*args, **kwargs)
test_03_as_maintainer(*args, **kwargs)
test_04_as_admin(*args, **kwargs)
class hawat.blueprints.filters.test.FiltersListTestCase(methodName='runTest')[source]

Bases: TestRunnerMixin, HawatTestCase

Class for testing filters.list endpoint.

test_01_as_user(*args, **kwargs)
test_02_as_developer(*args, **kwargs)
test_03_as_maintainer(*args, **kwargs)
test_04_as_admin(*args, **kwargs)
class hawat.blueprints.filters.test.FiltersShowTestCase(methodName='runTest')[source]

Bases: FilterTestMixin, TestRunnerMixin, HawatTestCase

Base class for testing filters.show endpoint.

test_01_as_user(*args, **kwargs)
test_02_as_developer(*args, **kwargs)
test_03_as_maintainer(*args, **kwargs)
test_04_as_admin(*args, **kwargs)
class hawat.blueprints.filters.test.FiltersUpdateTestCase(methodName='runTest')[source]

Bases: FilterTestMixin, TestRunnerMixin, HawatTestCase

Class for testing filters.update endpoint.

test_01_as_user(*args, **kwargs)
test_04_as_developer(*args, **kwargs)
test_05_as_maintainer(*args, **kwargs)
test_06_as_admin(*args, **kwargs)