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 a ValueError for non co-prime a,n

tests.unit.test_grouptheory.test_multiplicative_order_bad_a_type_float()

Test that lib.grouptheory.multiplicative_order() raises a TypeError 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 a TypeError 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 a TypeError 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 a TypeError 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 a ValueError 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 tests

Parameters:
  • 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: