ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants
Fixtures for testing the OntoUML constants.
This module provides fixtures for testing the constant values defined in the OntoUML vocabulary library. It imports various sets of predefined constants from the OntoUML vocabulary library and defines a dictionary to store the expected size of these sets. It also provides a set of utility functions for performing basic manipulations on tuples, which are used to generate a list of mutated tuples for testing.
Module Contents
Functions
|
Swap the first two elements of a given tuple. |
|
Remove the first element from a given tuple. |
|
Add a None element to the end of a given tuple. |
|
Replace the last element of a given tuple with the string "REPLACEMENT". |
|
Reverse the order of elements in a given tuple. |
Attributes
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.DICT_TUPLES_SIZE
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.swap_first_two(original)
Swap the first two elements of a given tuple.
- Parameters:
original (tuple) – The original tuple.
- Returns:
A new tuple with the first two elements swapped. If the tuple has fewer than two elements, returns the original tuple unmodified.
- Return type:
tuple
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.remove_first(original)
Remove the first element from a given tuple.
- Parameters:
original (tuple) – The original tuple.
- Returns:
A new tuple with the first element removed.
- Return type:
tuple
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.add_element(original)
Add a None element to the end of a given tuple.
- Parameters:
original (tuple) – The original tuple.
- Returns:
A new tuple with a None element added at the end.
- Return type:
tuple
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.replace_last(original)
Replace the last element of a given tuple with the string “REPLACEMENT”.
- Parameters:
original (tuple) – The original tuple.
- Returns:
A new tuple with the last element replaced by “REPLACEMENT”.
- Return type:
tuple
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.reverse_order(original)
Reverse the order of elements in a given tuple.
- Parameters:
original (tuple) – The original tuple.
- Returns:
A new tuple with the order of elements reversed.
- Return type:
tuple
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.MUTATIONS
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.TUPLES
- ontouml_vocabulary_lib.tests.test_constants.fixtures_test_constants.MUTANTS