beat.web.attestations.tests module

class beat.web.attestations.tests.AttestationsAPIBase(methodName='runTest')[source]

Bases: beat.web.common.testutils.BaseTestCase

ALGORITHM_TOOLCHAIN_DECLARATION = '{\n "language": "python",\n "schema_version": 1,\n "splittable": false,\n "groups": [\n {\n "inputs": {\n "in": { "type": "system/float/1" }\n },\n "outputs": {\n "out": { "type": "system/float/1" }\n }\n }\n ],\n "parameters": {\n }\n}'
ALGORITHM_CODE = 'class Algorithm:\n\n def process(self, inputs, outputs):\n return True\n\n'
ANALYZER_TOOLCHAIN_DECLARATION = '{\n "language": "python",\n "schema_version": 1,\n "groups": [\n {\n "inputs": {\n "in": { "type": "system/float/1" }\n }\n }\n ],\n "results": {\n "sum": {\n "type": "system/float/1",\n "display": false\n }\n },\n "parameters": {\n "score": { "type": "float32" }\n }\n}'
ANALYZER_CODE = 'class Algorithm:\n\n def process(self, inputs, output):\n return True\n\n'
TOOLCHAIN_DECLARATION = {'analyzers': [{'inputs': ['in'], 'synchronized_channel': 'dataset1', 'name': 'analyzer1'}], 'blocks': [{'name': 'block1', 'inputs': ['in'], 'outputs': ['out'], 'synchronized_channel': 'dataset1'}], 'connections': [{'from': 'dataset1.out', 'to': 'block1.in', 'channel': 'dataset1'}, {'from': 'block1.out', 'to': 'analyzer1.in', 'channel': 'dataset1'}], 'datasets': [{'name': 'dataset1', 'outputs': ['out']}], 'representation': {'blocks': {}, 'channel_colors': {}, 'connections': {}}}
EXPERIMENT_DECLARATION = {'analyzers': {'analyzer1': {'algorithm': 'jackdoe/analyzer1/1', 'inputs': {'in': 'in'}, 'parameters': {}}}, 'blocks': {'block1': {'algorithm': 'jackdoe/algorithm1/1', 'inputs': {'in': 'in'}, 'outputs': {'out': 'out'}, 'parameters': {}}}, 'datasets': {'dataset1': {'database': 'database1/1', 'protocol': 'protocol1', 'set': 'set1'}}, 'globals': {'environment': {'name': 'env1', 'version': '1.0'}, 'queue': 'queue1'}}
DATABASE = {'protocols': [{'name': 'protocol1', 'template': 'test', 'sets': [{'name': 'set1', 'template': 'set', 'view': 'dummy', 'outputs': {'out': 'system/float/1'}}]}], 'root_folder': '/path/to/root/folder'}
login_johndoe()[source]
login_jackdoe()[source]
setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

class beat.web.attestations.tests.AttestationCreationAPI(methodName='runTest')[source]

Bases: beat.web.attestations.tests.AttestationsAPIBase

setUp()[source]

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

test_no_access_for_anonymous_user()[source]
test_bad_request_with_invalid_content_type()[source]
test_bad_request_with_unknown_experiment()[source]
test_create_attestation()[source]
class beat.web.attestations.tests.AttestationUnlockingAPI(methodName='runTest')[source]

Bases: beat.web.attestations.tests.AttestationsAPIBase

setUp()[source]

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

test_no_access_for_anonymous_user()[source]
test_bad_request_with_invalid_content_type()[source]
test_bad_request_with_unknown_number()[source]
test_fail_to_unlock_attestation_of_other_user()[source]
test_unlock_attestation()[source]
test_unlock_attestation_with_visible_algorithm()[source]
class beat.web.attestations.tests.AttestationDeletionAPI(methodName='runTest')[source]

Bases: beat.web.attestations.tests.AttestationsAPIBase

setUp()[source]

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

test_no_access_for_anonymous_user()[source]
test_with_other_user()[source]
test_with_invalid_number()[source]
test_unlocked_attestation()[source]
test_normal_case()[source]
class beat.web.attestations.tests.CleanAttstationManagementCommandTestCase(methodName='runTest')[source]

Bases: beat.web.attestations.tests.AttestationsAPIBase

run_command()[source]

Runs the clean_attestation command

test_basic_usage()[source]

Check the operation of the clean_attestation management command

test_valid_attestation()[source]
test_outdated_attestation()[source]
test_unlocked_attestation()[source]