lomas_server.tests package

Submodules

lomas_server.tests.constants module

lomas_server.tests.test_api module

class lomas_server.tests.test_api.TestRootAPIEndpoint(methodName='runTest')[source]

Bases: TestSetupRootAPIEndpoint

End-to-end tests of the api endpoints.

test_get_dataset_metadata() None[source]

Test_get_dataset_metadata.

test_get_dummy_dataset() None[source]

Test_get_dummy_dataset.

test_get_initial_budget() None[source]

Test_get_initial_budget.

test_get_previous_queries() None[source]

Test_get_previous_queries.

test_get_remaining_budget() None[source]

Test_get_remaining_budget.

test_get_total_spent_budget() None[source]

Test_get_total_spent_budget.

test_root() None[source]

Test root endpoint redirection to state endpoint.

test_state() None[source]

Test state endpoint.

test_subsequent_budget_limit_logic() None[source]

Test_subsequent_budget_limit_logic.

test_unknown_endpoint() None[source]

Test endpoint that does not exist.

lomas_server.tests.test_api_diffprivlib module

class lomas_server.tests.test_api_diffprivlib.TestDiffPrivLibEndpoint(methodName='runTest')[source]

Bases: TestSetupRootAPIEndpoint

Test DiffPrivLib Endpoint with different models.

test_clustering_models() None[source]

Test diffprivlib query: K-Means.

test_diffprivlib_compatibility_error() None[source]

Test diffprivlib compatibility error.

test_diffprivlib_cost() None[source]

Test_diffprivlib_cost.

test_diffprivlib_privacy_leak() None[source]

Test diffprivlib privacy leak error.

test_diffprivlib_query() None[source]

Test diffprivlib query.

test_dimension_reduction_models() None[source]

Test diffprivlib query: PCA.

test_dummy_diffprivlib_query() None[source]

Test_dummy_diffprivlib_query.

test_linear_regression_models() None[source]

Test diffprivlib query: Linear Regression.

test_linear_regression_models_same_columns() None[source]

Test diffprivlib query: Same columns.

test_logistic_regression_models() None[source]

Test diffprivlib query: Logistic Regression.

test_naives_bayes_model() None[source]

Test diffprivlib query: Gaussian Naives Bayes.

test_trees_models() None[source]

Test diffprivlib query: Random Forest, Decision Tree.

lomas_server.tests.test_api_diffprivlib.validate_pipeline(client, response) QueryResponse[source]

Validate that the pipeline ran successfully.

Returns a model and a score.

lomas_server.tests.test_api_smartnoise_synth module

class lomas_server.tests.test_api_smartnoise_synth.TestSmartnoiseSynthEndpoint(methodName='runTest')[source]

Bases: TestSetupRootAPIEndpoint

Test Smartnoise Synth Endpoints with different Synthesizers.

test_dummy_smartnoise_synth_query() None[source]

Test_dummy_smartnoise_synth_query.

test_smartnoise_synth_cost() None[source]

Test_smartnoise_synth_cost.

test_smartnoise_synth_query() None[source]

Test smartnoise synth query.

test_smartnoise_synth_query_aim() None[source]

Test smartnoise synth query AIM Synthesizer.

test_smartnoise_synth_query_constraints() None[source]

Test smartnoise synth query constraints.

test_smartnoise_synth_query_datetime() None[source]

Test smartnoise synth query on other dataset for datetime columns.

test_smartnoise_synth_query_delta_none() None[source]

Test smartnoise synth query on other synthesizer with delta None.

test_smartnoise_synth_query_dpgan() None[source]

Test smartnoise synth query dpgan Synthesizer.

test_smartnoise_synth_query_mst() None[source]

Test smartnoise synth query MST Synthesizer.

test_smartnoise_synth_query_mwem() None[source]

Test smartnoise synth query MWEM Synthesizer.

test_smartnoise_synth_query_pacsynth() None[source]

Test smartnoise synth query PAC-Synth Synthesizer.

TOO UNSTABLE BECAUSE OF RUST PANIC

test_smartnoise_synth_query_patectgan() None[source]

Test smartnoise synth query PATE-CTGAN Synthesizer.

test_smartnoise_synth_query_pategan() None[source]

Test smartnoise synth query pategan Synthesizer.

test_smartnoise_synth_query_private_id() None[source]

Test smartnoise synth query on other dataset for private id.

and categorical int columns

test_smartnoise_synth_query_samples() None[source]

Test smartnoise synth query return samples.

test_smartnoise_synth_query_select_cols() None[source]

Test smartnoise synth query select_cols.

lomas_server.tests.test_api_smartnoise_synth.validate_response(client, response, headers=None) QueryResponse[source]

Validate that the pipeline ran successfully.

Returns a model and a score.

lomas_server.tests.test_collection_models module

class lomas_server.tests.test_collection_models.TestMetadataModel(methodName='runTest')[source]

Bases: TestCase

Tests for the input validation of dataset metadata.

test_boolean_column() None[source]

Test_boolean_column.

test_categories() None[source]

Test categories validation.

test_categories_match_cardinality() None[source]

Test categories match cardinality.

test_categories_match_type() None[source]

Test categories match column type.

test_categories_required() None[source]

Test categories required.

test_datetime_column() None[source]

Test_datetime_column.

test_float_column() None[source]

Test_float_column.

test_int_column() None[source]

Test_int_column.

test_lower_upper_bounded() None[source]

Test lower is smaller than upper and of right type.

test_metadata_columns_discriminator() None[source]

Test metadata column discriminator.

test_precision() None[source]

Test precision can only be 32 or 64.

test_standard_metadata_fields() None[source]

Test standard metadata fields.

lomas_server.tests.test_dummy_generation module

class lomas_server.tests.test_dummy_generation.TestMakeDummyDataset(methodName='runTest')[source]

Bases: TestCase

Tests for the generation of dummy datasets.

metadata: ClassVar[dict[str, Any]] = {'columns': {}, 'max_ids': 1, 'row_privacy': True, 'rows': 100}
test_boolean_column() None[source]

Test_boolean_column.

test_categorical_column() None[source]

Test_categorical_column.

test_datetime_column() None[source]

Test_datetime_column.

test_float_column() None[source]

Test_float_column.

test_int_column() None[source]

Test_int_column.

test_nullable_column() None[source]

Test_nullable_column.

test_seed() None[source]

Test_seed.

lomas_server.tests.test_mongodb_admin module

lomas_server.tests.test_mongodb_admin_cli module

Module contents