示例#1
0
def test_basic():
    assert power(2, 3, 1000) == 9
示例#2
0
def test_second():
    assert power(5, 0, 10) == 1
示例#3
0
def test_mod(mod):
    assert power(2, 4, 10000) == 16
    assert power(2, 10, mod.modulus) == 0
示例#4
0
def test_exception():
    with pytest.raises(Exception):
        res = power(0, 0, 2)
示例#5
0
 def test_ten(self):
     assert power(0, 10, 1000) == 0
示例#6
0
 def test_hundred(self):
     assert power(0, 100, 1000) == 0
示例#7
0
def test_mod(mod):
	assert power(2, 4, 10000) == 16
	assert power(2, 10, mod.modulus) == 0
示例#8
0
def test_basic():
	assert power(2, 3, 1000) == 8
示例#9
0
def test_exception():
	with pytest.raises(Exception):
		res = power(0, 0, 2)
示例#10
0
def test_second():
	assert power(5, 0, 10) == 1
示例#11
0
	def test_hundred(self):
		assert power(0, 100, 1000) == 0
示例#12
0
	def test_ten(self):
		assert power(0, 10, 1000) == 0
	def test_p2_basic(self):
		if pytest.config.p2:
			print 'Testing for %d' % pytest.config.p2
			assert power(2, pytest.config.p2, 1000000) == \
				(math.pow(2, pytest.config.p2) % 1000000)