Exemple #1
0
def test_hypotenuse():
    found = funcs.hypotenuse(3, 4)
    expected = 5
    assert found == expected

    found = funcs.hypotenuse(3, -4)
    expected = 5
    assert found == expected

    found = funcs.hypotenuse(6, 8)
    expected = 10
    assert found == expected
Exemple #2
0
 def test_hyp_2(self):
     self.assertAlmostEqual(funcs.hypotenuse(6.0, 8), 10.0)
Exemple #3
0
 def test_hyp_1(self):
     self.assertEqual(funcs.hypotenuse(3, 4), 5)
def distance(pt1, pt2):
    return funcs.hypotenuse(pt1.x - pt2.x, pt1.y - pt2.y)
Exemple #5
0
 def test_hypotenuse(self):
     self.assertAlmostEqual(hypotenuse(2, 3), 3.6055513)
     self.assertEqual(hypotenuse(3, 4), 5)
Exemple #6
0
 def test_h_2(self):
    self.assertEqual(funcs.hypotenuse(3,4),5)
 def test_f_3a(self):
     self.assertEqual(funcs.hypotenuse(-4, -3), 5)
Exemple #8
0
 def test_f_1(self):
    self.assertEqual(funcs.f(1), 9)
    self.assertEqual(funcs.g(1,1), 2)
    self.assertEqual(funcs.hypotenuse(3,4), 5)
    self.assertEqual(funcs.is_positive(3.50), True)
Exemple #9
0
 def test_hypotenuse_1(self):
    self.assertEqual(funcs.hypotenuse(5, 3), math.sqrt(34))
Exemple #10
0
   def test_hypotenuse(self):
      self.assertEqual(funcs.hypotenuse(3, 4), 5)

      self.assertEqual(funcs.hypotenuse(0, 0), 0)
      # Add code here.
      pass
Exemple #11
0
 def test_f_2(self):
    # Add code here.
    self.assertEqual(funcs.f(3.0), 69)
    self.assertEqual(funcs.g(67, -2), 4493)
    self.assertEqual(funcs.hypotenuse(4.7, 6.9), 8.3486525858967209)
    self.assertEqual(funcs.is_positive(-3.4123849394), False)
Exemple #12
0
 def test_f6(self):
     h2 = funcs.hypotenuse(6, 8)
     self.assertEqual(h2, 10)
Exemple #13
0
 def test_f5(self):
     h1 = funcs.hypotenuse(3, 4)
     self.assertEqual(h1, 5)
Exemple #14
0
 def test_hypotenuse_2(self):
     self.assertEquals(funcs.hypotenuse(5, 12), 13)
     pass
Exemple #15
0
 def test_hyp_3(self):
     self.assertEqual(funcs.hypotenuse(39, 80), 89)
Exemple #16
0
 def test_hypotenuse_2(self):
    self.assertEqual(funcs.hypotenuse(34, 26), math.sqrt(1832))
 def test_f_3(self):
     self.assertEqual(funcs.hypotenuse(4, 3), 5)
 def test_hypotenuse_1(self):
  self.assertEqual(hypotenuse(3,4),5)
def length_vector(vector):
    return funcs.hypotenuse(vector.z, funcs.hypotenuse(vector.x, vector.y))
 def test_hypotensue_2(self):
  self.assertEqual(hypotenuse(-4,3),5)
Exemple #21
0
 def test_h_1(self):
    self.assertEqual(funcs.hypotenuse(5,12),13)
    pass
Exemple #22
0
 def test_hypotenuse(self):
     self.assertEqual(funcs.hypotenuse(1, 0), 1)
 def test_f_3(self):
     self.assertAlmostEqual(funcs.hypotenuse(5, 6), 7.810249675906654)
     self.assertAlmostEqual(funcs.hypotenuse(3, 7), 7.615773105863909)
Exemple #24
0
 def test_h_2(self):
    self.assertEqual(funcs.hypotenuse(2, 1), 2.23606797749979)