def test_unknown_operator(self): with pytest.raises(ValueError): calculate_prefix("& 1 2")
def test_additional_operators(self): with pytest.raises(ValueError): calculate_prefix("+ - * 1 2")
def test_additional_whitespace(self): assert calculate_prefix(" + 1 2 ") == 3
def test_empty_string(self): with pytest.raises(ValueError): calculate_prefix("")
def test_base_case(self): assert calculate_prefix("+ 1 2") == 3
def test_single_number(self): assert calculate_prefix("3") == 3