コード例 #1
0
 def testFloats(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             x = x / 10.0
             y = y / 10.0
             p = my_math.product(x, y)
             self.assertTrue(p == x * y, 'Float multiplication failed')
コード例 #2
0
 def testFloater(self):
     for x in xrange(-10,10):
         for y in xrange(-10,10):
             x/=10.0
             y/=10.0
             p=my_math.product(x, y)
             self.failUnless(p==x*y,'Flaot multiplication failed!')
コード例 #3
0
ファイル: test_my_math.py プロジェクト: rubenmit/py-practice
 def testFloat(self):
     for x in xrange(-10, 10):
         for y in xrange(-10, 10):
             x = x / 10.0
             y = y / 10.0
             p = my_math.product(x, y)
             self.failUnless(p == x * y, 'Float multiplication failed')
コード例 #4
0
ファイル: test14.py プロジェクト: hisuley/sxj
 def testFloats(self):
     for x in xrange(-10, 10):
         for y in xrange(-10, 10):
             x = x / 10.0
             y = y / 10.0
             p = my_math.product(x, y)
         self.failUnless(p == x * y, 'Float multiplication failed')
コード例 #5
0
ファイル: test_my_math.py プロジェクト: zjxht62/LearnPython
 def test_float(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             x = x / 10
             y = y / 10
             p = my_math.product(x, y)
             self.assertEqual(p, x * y, 'Float multiplication failed')
コード例 #6
0
 def testIntegers(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             p = my_math.product(x, y)
             self.assertTrue(p == x * y, 'Integer multiplication failed')
コード例 #7
0
ファイル: unitTest.py プロジェクト: LuoXiaojie/studyPY
 def testIntegers(self):
     for x in xrange(-10, 10):
         for y in xrange(-10, 10):
             p = my_math.product(x, y)
             self.failUnless(p == x * y, 'Integer multiplication failed')
コード例 #8
0
 def testIntegers(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             p = my_math.product(x, y)
             self.assertTrue(p == x*y, 'Integer multiplication failed')
コード例 #9
0
 def testFloat(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             p = my_math.product(x / 10.0, y / 10.0)
             self.failUnless(p == (x / 10.0) * (y / 10.0),
                             "Integer multiplication failed")
コード例 #10
0
def test_product():
    assert my_math.product(5, 5) == 25
    assert my_math.product(5, 2.5) == 12.5
コード例 #11
0
def test_product():
    assert my_math.product(7, 3) == 21
    assert my_math.product(7, -1) == -7
    assert my_math.product(3, 3) == 9
コード例 #12
0
def test_product():
    assert my_math.product(3, 6) == 18
    assert my_math.product(5, 5) == 25
コード例 #13
0
def multisum_length(degrees):
    return product([sum_length(degree) for degree in degrees])
コード例 #14
0
ファイル: test_my_math.py プロジェクト: vasalskyy/testowanie1
def test_product():
    assert my_math.product(7, 3) == 21
    assert my_math.product(7, -1) == -7
    assert my_math.product(4.3, 5.3) == 22.79
コード例 #15
0
ファイル: unitTest.py プロジェクト: zzucainiao/code-backup
 def testFloat(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             p = my_math.product(x/10.0, y/10.0)
             self.failUnless(p == (x/10.0) * (y/10.0), "Integer multiplication failed")
コード例 #16
0
ファイル: test_cases.py プロジェクト: singhwarrior/python
 def test_integer_product(self):
     for x in range(-10, 10):
         for y in range(-10, 10):
             p = my_math.product(x, y)
             self.assertEqual(p, x * y, 'Integer multiplication failed')
コード例 #17
0
ファイル: test14.py プロジェクト: hisuley/sxj
 def testIntegers(self):
     for x in xrange(-10, 10):
         for y in xrange(-10, 10):
             p = my_math.product(x, y)
             self.failUnless(p == x * y, 'Integer multiplication failed')
コード例 #18
0
def test_product():
    assert my_math.product(3, 3) == 9
    assert my_math.product(10, 1) == 10
    assert my_math.product(20, 0.5) == 10
    assert my_math.product(10, -1) == -10
    assert my_math.product(10, 0) == 0