Exemple #1
0
 def test_numpy_vector_passes(self):
     negative(np.asarray((-1, -2, -3, -4)))
Exemple #2
0
    def test_numpy_vector_fails(self):
        with pytest.raises(ValueError):
            negative((0, 0, 0, 0))

        with pytest.raises(ValueError):
            negative((1, 2, 3, 4))
Exemple #3
0
    def test_tuple_fails(self):
        with pytest.raises(ValueError):
            negative((0, 0, 0, 0))

        with pytest.raises(ValueError):
            negative((1, 2, 3, 4))
Exemple #4
0
 def test_tuple_passes(self):
     negative((-1, -2, -3, -4))
Exemple #5
0
 def test_list_passes(self):
     negative([-1, -2, -3, -4])
Exemple #6
0
 def test_scalar_fails(self):
     with pytest.raises(ValueError):
         negative(4)
     with pytest.raises(ValueError):
         negative(0)
Exemple #7
0
 def test_scalar_passes(self):
     negative(-4)