Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Rename test class in arithgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Mar 25, 2022
1 parent aa78065 commit d4481b2
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/sage/modular/arithgroup/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def random_odd_arithgroup(index, nu3_max=None):
return G.one_odd_subgroup(random=True)


class Test:
class _Test:
r"""
Testing class for arithmetic subgroup implemented via permutations.
"""
Expand All @@ -106,8 +106,8 @@ def __init__(self, index=20, index_max=50, odd_probability=0.5):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test()
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test()
Arithmetic subgroup testing class
"""
self.congroups = []
Expand Down Expand Up @@ -139,8 +139,8 @@ def __repr__(self):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().__repr__()
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().__repr__()
'Arithmetic subgroup testing class'
"""
return "Arithmetic subgroup testing class"
Expand All @@ -152,13 +152,13 @@ def _do(self, name):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test()._do("random")
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test()._do("random")
test_random
...
"""
print("test_%s" % name)
Test.__dict__["test_%s" % name](self)
_Test.__dict__["test_%s" % name](self)

def random(self, seconds=0):
"""
Expand All @@ -167,8 +167,8 @@ def random(self, seconds=0):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().random(1)
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().random(1)
test_random
...
"""
Expand All @@ -182,8 +182,8 @@ def test(self, name, seconds=0):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: T = Test()
sage: from sage.modular.arithgroup.tests import _Test
sage: T = _Test()
sage: T.test('relabel',seconds=1)
test_relabel
...
Expand Down Expand Up @@ -215,24 +215,24 @@ def test_random(self):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().test_random() #random
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().test_random() #random
Doing random test
"""
tests = [a for a in Test.__dict__
tests = [a for a in _Test.__dict__
if a[:5] == "test_" and a != "test_random"]
name = prandom.choice(tests)
print("Doing random test %s" % name)
Test.__dict__[name](self)
_Test.__dict__[name](self)

def test_relabel(self):
r"""
Try the function canonical labels for a random even modular subgroup.
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().test_relabel() # random
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().test_relabel() # random
"""
if prandom.uniform(0, 1) < self.odd_probability:
G = random_odd_arithgroup(self.index)
Expand Down Expand Up @@ -285,8 +285,8 @@ def test_congruence_groups(self):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().test_congruence_groups() #random
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().test_congruence_groups() #random
"""
G = prandom.choice(self.congroups)
GG = G.as_permutation_group()
Expand Down Expand Up @@ -325,8 +325,8 @@ def test_contains(self):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().test_contains() #random
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().test_contains() #random
"""
if prandom.uniform(0, 1) < self.odd_probability:
G = random_odd_arithgroup(self.index)
Expand All @@ -346,8 +346,8 @@ def test_spanning_trees(self):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().test_spanning_trees() #random
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().test_spanning_trees() #random
"""
from sage.all import prod
from .all import SL2Z
Expand Down Expand Up @@ -385,8 +385,8 @@ def test_todd_coxeter(self):
EXAMPLES::
sage: from sage.modular.arithgroup.tests import Test
sage: Test().test_todd_coxeter() #random
sage: from sage.modular.arithgroup.tests import _Test
sage: _Test().test_todd_coxeter() #random
"""
from .all import SL2Z
from .arithgroup_perm import S2m, S3m, Lm
Expand Down

0 comments on commit d4481b2

Please sign in to comment.