Exemple #1
0
def test_basic():
    assert power(2, 3, 1000) == 9
Exemple #2
0
def test_second():
    assert power(5, 0, 10) == 1
Exemple #3
0
def test_mod(mod):
    assert power(2, 4, 10000) == 16
    assert power(2, 10, mod.modulus) == 0
Exemple #4
0
def test_exception():
    with pytest.raises(Exception):
        res = power(0, 0, 2)
 def test_ten(self):
     assert power(0, 10, 1000) == 0
 def test_hundred(self):
     assert power(0, 100, 1000) == 0
def test_mod(mod):
	assert power(2, 4, 10000) == 16
	assert power(2, 10, mod.modulus) == 0
def test_basic():
	assert power(2, 3, 1000) == 8
def test_exception():
	with pytest.raises(Exception):
		res = power(0, 0, 2)
Exemple #10
0
def test_second():
	assert power(5, 0, 10) == 1
Exemple #11
0
	def test_hundred(self):
		assert power(0, 100, 1000) == 0
Exemple #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)