Exemplo n.º 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')
Exemplo n.º 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!')
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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')
Exemplo n.º 5
0
 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')
Exemplo n.º 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')
Exemplo n.º 7
0
 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')
Exemplo n.º 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')
Exemplo n.º 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")
Exemplo n.º 10
0
def test_product():
    assert my_math.product(5, 5) == 25
    assert my_math.product(5, 2.5) == 12.5
Exemplo n.º 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
Exemplo n.º 12
0
def test_product():
    assert my_math.product(3, 6) == 18
    assert my_math.product(5, 5) == 25
Exemplo n.º 13
0
def multisum_length(degrees):
    return product([sum_length(degree) for degree in degrees])
Exemplo n.º 14
0
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
Exemplo n.º 15
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")
Exemplo n.º 16
0
 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')
Exemplo n.º 17
0
 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')
Exemplo n.º 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