tests.unit.test_grouptheory
Module¶
This module contains all unit tests for the lib.grouptheory
package.
tests.unit.test_grouptheory
– Unit Tests¶
-
tests.unit.test_grouptheory.
test_multiplicative_order_bad_a_n_not_coprime
()¶ Test that
lib.grouptheory.multiplicative_order()
raises aValueError
for non co-prime a,n
-
tests.unit.test_grouptheory.
test_multiplicative_order_bad_a_type_float
()¶ Test that
lib.grouptheory.multiplicative_order()
raises aTypeError
for a non-int
value for a (float
)
-
tests.unit.test_grouptheory.
test_multiplicative_order_bad_a_type_str
()¶ Test that
lib.grouptheory.multiplicative_order()
raises aTypeError
for a non-int
value for a (str
)
-
tests.unit.test_grouptheory.
test_multiplicative_order_bad_n_type_float
()¶ Test that
lib.grouptheory.multiplicative_order()
raises aTypeError
for a non-int
value for n (float
)
-
tests.unit.test_grouptheory.
test_multiplicative_order_bad_n_type_str
()¶ Test that
lib.grouptheory.multiplicative_order()
raises aTypeError
for a non-int
value for n (str
)
-
tests.unit.test_grouptheory.
test_multiplicative_order_bad_n_zero
()¶ Test that
lib.grouptheory.multiplicative_order()
raises aValueError
for a non-positive value for n
-
tests.unit.test_grouptheory.
test_multiplicative_order_correctness
(a, n, order)¶ Test the correctness of
lib.grouptheory.multiplicative_order()
using known answer testsParameters: - a (
int
) – the base input value - n (
int
) – the modulus defining the multiplicative group - order (
int
) – the expected answer, i.e. \(ord_n(a)\)
Raises: - AssertionError – if
lib.grouptheory.multiplicative_order()
returns the wrong type - AssertionError – if
lib.grouptheory.multiplicative_order()
returns the wrong value
- a (