Пример #1
0
def test_base_exceptions_with_file_and_line() -> None:
    """Test the base exception class with file and line."""
    loc = location.Location(file_name="/foo/bar", line_number=42)
    e = ex.CleanRoomError("message", location=loc)
    assert str(e) == "Error in /foo/bar:42: message"
Пример #2
0
def test_base_exceptions_with_location() -> None:
    """Test the base exception class with file."""
    loc = location.Location(file_name="/foo/bar")
    e = ex.CleanRoomError("message", location=loc)
    assert str(e) == "Error in /foo/bar: message"
Пример #3
0
def test_base_exceptions() -> None:
    """Test the base exception class."""
    e = ex.CleanRoomError("message")
    assert str(e) == "Error: message"
Пример #4
0
def test_base_exceptions_multi_args() -> None:
    """Test the base exception class."""
    e = ex.CleanRoomError("message", "something")
    assert str(e) == "Error: ('message', 'something')"
Пример #5
0
def test_base_exceptions_multi_args() -> None:
    """Test the base exception class."""
    e = ex.CleanRoomError('message', 'something')
    assert str(e) == 'Error: (\'message\', \'something\')'