forked from cool-RR/python_toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_misc.py
More file actions
30 lines (23 loc) · 1.12 KB
/
test_misc.py
File metadata and controls
30 lines (23 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
from python_toolbox import cute_testing
from python_toolbox import math_tools
from python_toolbox import combi
def test():
assert combi.misc.get_short_factorial_string(7) == \
str(math_tools.factorial(7))
assert combi.misc.get_short_factorial_string(7, minus_one=True) == \
str(math_tools.factorial(7) - 1)
assert combi.misc.get_short_factorial_string(17) == '17!'
assert combi.misc.get_short_factorial_string(17, minus_one=True) == \
'17! - 1'
assert combi.misc.get_short_factorial_string(float('inf')) == \
'''float('inf')'''
assert combi.misc.get_short_factorial_string(float('inf'),
minus_one=True) == '''float('inf')'''
def test_things_in_root_namespace():
combi.binomial
combi.Bag
combi.OrderedBag
combi.FrozenBag
combi.FrozenOrderedBag