IntegrityTestCase

class IntegrityTestCase(methodName='runTest')[source]

Bases: TestCase

Data integrity tests.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods Summary

assert_canonical_identifier(prefix, ...)

Assert a given identifier is canonical.

assert_no_internal_redundancies(m, tuple_cls)

Assert that the list of mappings doesn't have any redundancies.

test_canonical_prefixes()

Test that all mappings use canonical bioregistry prefixes.

test_contributors()

Test all contributors have an entry in the curators.tsv file.

test_cross_redundancy()

Test the redundancy of manually curated mappings and predicted mappings.

test_curations_sorted()

Test the true curated mappings are in a canonical order.

test_false_mappings_sorted()

Test the false curated mappings are in a canonical order.

test_normalized_identifiers()

Test that all identifiers have been normalized (based on bioregistry definition).

test_prediction_types()

Test that the prediction type is pulled in properly.

test_predictions_sorted()

Test the predictions are in a canonical order.

test_relations()

Test that the relation is a CURIE.

test_unsure_sorted()

Test the unsure mappings are in a canonical order.

Methods Documentation

assert_canonical_identifier(prefix: str, identifier: str, label: str, line: int) None[source]

Assert a given identifier is canonical.

Parameters:
  • prefix – The prefix to check

  • identifier – The identifier in the semantic space for the prefix

  • label – The label of the mapping file

  • line – The line number of the mapping

assert_no_internal_redundancies(m: Iterable[Mapping[str, str]], tuple_cls)[source]

Assert that the list of mappings doesn’t have any redundancies.

test_canonical_prefixes()[source]

Test that all mappings use canonical bioregistry prefixes.

test_contributors()[source]

Test all contributors have an entry in the curators.tsv file.

test_cross_redundancy()[source]

Test the redundancy of manually curated mappings and predicted mappings.

test_curations_sorted()[source]

Test the true curated mappings are in a canonical order.

test_false_mappings_sorted()[source]

Test the false curated mappings are in a canonical order.

test_normalized_identifiers()[source]

Test that all identifiers have been normalized (based on bioregistry definition).

test_prediction_types()[source]

Test that the prediction type is pulled in properly.

test_predictions_sorted()[source]

Test the predictions are in a canonical order.

test_relations()[source]

Test that the relation is a CURIE.

test_unsure_sorted()[source]

Test the unsure mappings are in a canonical order.