Esempio n. 1
0
 def test_output_value(self):
     assert 2 == mod(10, 4)
     assert mod(2.2, 1) == pytest.approx(0.2)
     assert mod(2, 1.1) == pytest.approx(0.9)
Esempio n. 2
0
 def test_first_argument_validity(self):
     assert mod(VALUE_ERROR, 1) == VALUE_ERROR
     assert mod('x', 1) == VALUE_ERROR
Esempio n. 3
0
 def test_second_argument_validity(self):
     assert mod(2, VALUE_ERROR) == VALUE_ERROR
     assert mod(2, 'x') == VALUE_ERROR
     assert mod(2, 0) == DIV0
     assert mod(2, None) == DIV0
Esempio n. 4
0
 def test_second_argument_validity(self):
     with self.assertRaises(TypeError):
         mod(2, 1.1)
Esempio n. 5
0
 def test_output_value(self):
     self.assertEqual(mod(10, 4), 2)
Esempio n. 6
0
 def test_output_value(self):
     assert 2 == mod(10, 4)
     assert mod(2.2, 1) == pytest.approx(0.2)
     assert mod(2, 1.1) == pytest.approx(0.9)
Esempio n. 7
0
 def test_first_argument_validity(self):
     with self.assertRaises(TypeError):
         mod(2.2, 1)
Esempio n. 8
0
 def test_second_argument_validity(self):
     assert mod(2, VALUE_ERROR) == VALUE_ERROR
     assert mod(2, 'x') == VALUE_ERROR
     assert mod(2, 0) == DIV0
     assert mod(2, None) == DIV0
Esempio n. 9
0
 def test_first_argument_validity(self):
     assert mod(VALUE_ERROR, 1) == VALUE_ERROR
     assert mod('x', 1) == VALUE_ERROR
Esempio n. 10
0
 def test_output_value(self):
     self.assertEqual(mod(10, 4), 2)
Esempio n. 11
0
 def test_second_argument_validity(self):
     with self.assertRaises(TypeError):
         mod(2, 1.1)
Esempio n. 12
0
 def test_first_argument_validity(self):
     with self.assertRaises(TypeError):
         mod(2.2, 1)