Exemplo n.º 1
0
def test_get_scaling_factor_with_value_passed():
    # arrange
    sf = 3.141592
    # act
    scaling_factor = eddy.get_scaling_factor(sf)
    # assert
    assert scaling_factor == sf
Exemplo n.º 2
0
def test_get_scaling_factor_from_tkinter(mocker):
    # arrange
    mocker.patch("eddymc.eddy.simpledialog.askfloat", return_value=3.141592)
    # act
    scaling_factor = eddy.get_scaling_factor()
    # assert
    assert scaling_factor == 3.141592
Exemplo n.º 3
0
def test_get_scaling_factor_with_value_passed_as_string():
    # arrange
    sf = '3.141592'
    # act
    scaling_factor = eddy.get_scaling_factor(sf)
    # assert
    assert scaling_factor == 3.141592
Exemplo n.º 4
0
def test_get_scaling_factor_with_invalid_arg_passed():
    # arrange
    sf = 'parrot'
    # act, assert
    with pytest.raises(ValueError):
        eddy.get_scaling_factor(sf)