Example #1
0
    def test_numpy_vector_fails(self):
        with pytest.raises(ValueError):
            positive((0, 0, 0, 0))

        with pytest.raises(ValueError):
            positive((-1, -2, -3, -4))
Example #2
0
    def test_tuple_fails(self):
        with pytest.raises(ValueError):
            positive((0, 0, 0, 0))

        with pytest.raises(ValueError):
            positive((-1, -2, -3, -4))
Example #3
0
 def test_numpy_vector_passes(self):
     positive(np.asarray((1, 2, 3, 4)))
Example #4
0
 def test_tuple_passes(self):
     positive((1, 2, 3, 4))
Example #5
0
    def test_list_fails(self):
        with pytest.raises(ValueError):
            positive([0, 0, 0, 0])

        with pytest.raises(ValueError):
            positive([-1, -2, -3, -4])
Example #6
0
 def test_list_passes(self):
     positive((1, 2, 3, 4))
Example #7
0
 def test_scalar_fails(self):
     with pytest.raises(ValueError):
         positive(-4)
     with pytest.raises(ValueError):
         positive(0)
Example #8
0
 def test_scalar_passes(self):
     positive(4)