Пример #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
Пример #13
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)