beat.web.reports.tests module

class beat.web.reports.tests.ReportTestCase(methodName='runTest')[source]

Bases: rest_framework.test.APITestCase

DATABASE = {'protocols': [{'name': 'triple', 'template': 'test', 'sets': [{'name': 'default', 'template': 'set', 'view': 'dummy', 'outputs': {'output1': 'johndoe/single_integer/1', 'output2': 'johndoe/single_integer/1', 'output3': 'johndoe/single_integer/1'}}]}], 'root_folder': '/path/to/root_folder'}
TOOLCHAIN_ONE_ANALYZER = {'analyzers': [{'inputs': ['input'], 'synchronized_channel': 'dataset1', 'name': 'analysis'}], 'blocks': [{'name': 'addition1', 'inputs': ['a', 'b'], 'outputs': ['sum'], 'synchronized_channel': 'dataset1'}, {'name': 'addition2', 'inputs': ['a', 'b'], 'outputs': ['sum'], 'synchronized_channel': 'dataset1'}], 'connections': [{'from': 'dataset1.output1', 'to': 'addition1.a', 'channel': 'dataset1'}, {'from': 'dataset1.output2', 'to': 'addition1.b', 'channel': 'dataset1'}, {'from': 'addition1.sum', 'to': 'addition2.a', 'channel': 'dataset1'}, {'from': 'dataset1.output3', 'to': 'addition2.b', 'channel': 'dataset1'}, {'to': 'analysis.input', 'from': 'addition2.sum', 'channel': 'dataset1'}], 'datasets': [{'name': 'dataset1', 'outputs': ['output1', 'output2', 'output3']}], 'representation': {'blocks': {}, 'channel_colors': {}, 'connections': {}}}
TOOLCHAIN_TWO_ANALYZERS = {'analyzers': [{'inputs': ['input'], 'synchronized_channel': 'dataset1', 'name': 'analysis'}, {'inputs': ['input'], 'synchronized_channel': 'dataset1', 'name': 'analysis2'}], 'blocks': [{'name': 'addition1', 'inputs': ['a', 'b'], 'outputs': ['sum'], 'synchronized_channel': 'dataset1'}, {'name': 'addition2', 'inputs': ['a', 'b'], 'outputs': ['sum'], 'synchronized_channel': 'dataset1'}], 'connections': [{'from': 'dataset1.output1', 'to': 'addition1.a', 'channel': 'dataset1'}, {'from': 'dataset1.output2', 'to': 'addition1.b', 'channel': 'dataset1'}, {'from': 'addition1.sum', 'to': 'addition2.a', 'channel': 'dataset1'}, {'from': 'dataset1.output3', 'to': 'addition2.b', 'channel': 'dataset1'}, {'to': 'analysis.input', 'from': 'addition2.sum', 'channel': 'dataset1'}, {'to': 'analysis2.input', 'from': 'addition2.sum', 'channel': 'dataset1'}], 'datasets': [{'name': 'dataset1', 'outputs': ['output1', 'output2', 'output3']}], 'representation': {'blocks': {}, 'channel_colors': {}, 'connections': {}}}
ALGORITHM_DECLARATION = '{\n "language": "python",\n "splittable": false,\n "groups": [\n {\n "inputs": {\n "a": { "type": "johndoe/single_integer/1" },\n "b": { "type": "johndoe/single_integer/1" }\n },\n "outputs": {\n "sum": { "type": "johndoe/single_integer/1" }\n }\n }\n ],\n "parameters": {\n }\n}'
ALGORITHM_CODE = "class Algorithm:\n\n def process(self, inputs, outputs):\n data = outputs['sum'].createData()\n data.value = inputs['a'].data.value + inputs['b'].data.value\n outputs['sum'].write(data)\n return True\n"
ANALYZER_DECLARATION = '{\n "language": "python",\n "groups": [\n {\n "inputs": {\n "in": { "type": "johndoe/single_integer/1" }\n }\n }\n ],\n "results": {\n "out_float": { "type": "float32" },\n "out_text": { "type": "string" }\n },\n "parameters": {\n }\n}'
ANALYZER_CODE = "class Algorithm:\n\n def process(self, inputs, output):\n # We don't really care\n return True\n"
CONFIGURATION_ANALYZER1 = {'analyzers': {'analysis': {'algorithm': 'johndoe/analyzer1/1', 'inputs': {'in': 'input'}, 'parameters': {}}}, 'blocks': {'addition1': {'algorithm': 'johndoe/sum/1', 'inputs': {'a': 'a', 'b': 'b'}, 'outputs': {'sum': 'sum'}, 'parameters': {}}, 'addition2': {'algorithm': 'johndoe/sum/1', 'inputs': {'a': 'a', 'b': 'b'}, 'outputs': {'sum': 'sum'}, 'parameters': {}}}, 'datasets': {'dataset1': {'database': 'integers/1', 'protocol': 'triple', 'set': 'default'}}, 'globals': {'environment': {'name': 'env1', 'version': '1.0'}, 'queue': 'queue1'}}
CONFIGURATION_ANALYZER2 = {'analyzers': {'analysis': {'algorithm': 'johndoe/analyzer2/1', 'inputs': {'in': 'input'}, 'parameters': {}}}, 'blocks': {'addition1': {'algorithm': 'johndoe/sum/1', 'inputs': {'a': 'a', 'b': 'b'}, 'outputs': {'sum': 'sum'}, 'parameters': {}}, 'addition2': {'algorithm': 'johndoe/sum/1', 'inputs': {'a': 'a', 'b': 'b'}, 'outputs': {'sum': 'sum'}, 'parameters': {}}}, 'datasets': {'dataset1': {'database': 'integers/1', 'protocol': 'triple', 'set': 'default'}}, 'globals': {'environment': {'name': 'env1', 'version': '1.0'}, 'queue': 'queue1'}}
CONFIGURATION_TWO_ANALYZERS = {'analyzers': {'analysis': {'algorithm': 'johndoe/analyzer1/1', 'inputs': {'in': 'input'}, 'parameters': {}}, 'analysis2': {'algorithm': 'johndoe/analyzer2/1', 'inputs': {'in': 'input'}, 'parameters': {}}}, 'blocks': {'addition1': {'algorithm': 'johndoe/sum/1', 'inputs': {'a': 'a', 'b': 'b'}, 'outputs': {'sum': 'sum'}, 'parameters': {}}, 'addition2': {'algorithm': 'johndoe/sum/1', 'inputs': {'a': 'a', 'b': 'b'}, 'outputs': {'sum': 'sum'}, 'parameters': {}}}, 'datasets': {'dataset1': {'database': 'integers/1', 'protocol': 'triple', 'set': 'default'}}, 'globals': {'environment': {'name': 'env1', 'version': '1.0'}, 'queue': 'queue1'}}
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.

create_experiment(author, toolchain, name, configuration, status='D')[source]
class beat.web.reports.tests.ReportListTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
class beat.web.reports.tests.ReportUserListTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
class beat.web.reports.tests.ReportCreationTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_logged_in_user_existing_name()[source]
test_logged_in_user__one_experiment()[source]
test_logged_in_user__two_compatible_experiments()[source]
test_logged_in_user__two_incompatible_experiments()[source]
test_logged_in_user__one_experiment__two_analyzers()[source]
class beat.web.reports.tests.EditableReportRetrievalTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.LockedReportRetrievalTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportRetrievalTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.EditableReportUpdateTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.LockedReportUpdateTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportUpdateTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.EditableReportDeletionTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.LockedReportDeletionTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportDeletionTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.EditableReportLockingTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user_empty_report_no_experiments()[source]
test_logged_in_user_empty_report_with_experiments()[source]
test_logged_in_user_non_empty_report_with_experiments()[source]
test_logged_in_user_non_empty_report_unaccessible_attestation()[source]
test_logged_in_user_non_empty_report_accessible_attestation_not_public_experiment()[source]
test_logged_in_user_non_empty_report_accessible_attestation_public_experiment()[source]
test_different_user()[source]
class beat.web.reports.tests.LockedReportLockingTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportLockingTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.EditableReportPublishTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.LockedReportPublishTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportPublishTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.EditableReportAddExperimentsTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_different_user()[source]
test_logged_in_user__one_experiment__one_analyzer()[source]
test_logged_in_user__one_inaccessible_experiment()[source]
test_logged_in_user__two_experiments__compatible_analyzers()[source]
test_logged_in_user__two_experiments__incompatible_analyzers()[source]
test_logged_in_user__one_experiment__two_analyzers()[source]
test_logged_in_user__compatible_experiment_addition()[source]
test_logged_in_user__incompatible_experiment_addition()[source]
test_with_unknown_experiments()[source]
class beat.web.reports.tests.LockedReportAddExperimentsTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportAddExperimentsTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.EditableReportRemoveExperimentsTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
test_with_unknown_experiments()[source]
class beat.web.reports.tests.LockedReportRemoveExperimentsTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]
class beat.web.reports.tests.PublishedReportRemoveExperimentsTestCase(methodName='runTest')[source]

Bases: beat.web.reports.tests.ReportTestCase

setUp()[source]

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

test_anonymous_user()[source]
test_logged_in_user()[source]
test_different_user()[source]