def test_snell_zero(): """Test for exceptions.""" incoming = 0 vtop = 0 vbottom = 100 with pytest.raises(ValueError): snell_angle(incoming, vtop, vbottom)
def test_snell(): """Test the basic wind component calculation.""" res = snell_angle(12, 2500, 4000) assert_almost_equal(res, 19.43022, 4)
def test_top_velocity_error(): """Test that warning is raised when velocity of top error is 0.""" with pytest.raises(ValueError): snell_angle(4., 0., 0.)
def test_snell_zero_velocity_top(): with pytest.raises(ValueError): snell_angle(12, 0, 4000)
def test_snell_zero_velocity_top(): """Test that a value error is raised with a zero velocity top layer.""" with pytest.raises(ValueError): snell_angle(12, 0, 4000)
def test_snell_zero_velocity_top(): """ Tests exception is raised when top velocity is zero. """ with pytest.raises(ValueError): snell_angle(5, 0, 2)
def test_snell_zero_velocity_top(): """Test to ensure that a ValueError is raised on the `snell_angle` function when the top layer velocity is zero""" with pytest.raises(ValueError): snell_angle(30, 0, 2000)
def test_exception_snell_angle(): """Test that warning is raised when wind direction > 360.""" with pytest.raises(ValueError): snell_angle(3, 0, 12)
def test_snell_angle_ValueError(): """Test that a ValueError is raised on the snell_angle function when the top layer velocity.""" with pytest.raises(ValueError): snell_angle(12, 0, 4000)
def test_snell_to_layer_zero_raises(): """Test get_wind_components warning when out of range.""" with pytest.raises(ValueError): snell_angle(12, 0, 4000)
def test_snell_zero_velocity(): """Test that error is raised with zero velocity.""" with pytest.raises(ValueError): snell_angle(200, 0, 20)
def test_snell_excep(): with pytest.raises(ValueError): snell_angle(12, 0, 4000)
def test_value_error(): """ Test value error """ with pytest.raises(ValueError): snell_angle(0, 0, 0)