Пример #1
0
def test_validate_error_with_string():
    """If given a string _validate_error() should return it wrapped in a dict.

    """
    assert db._validate_error("Something went wrong") == {
        "message": "Something went wrong"
    }
Пример #2
0
def test_validate_error_with_none():
    """_validate_error() should return None if given None."""
    assert db._validate_error(None) is None
Пример #3
0
def test_validate_error_with_valid_dict():
    """If given a valid dict _validate_error() should return the same dict."""
    job_dict = {"message": "Something went wrong"}
    assert db._validate_error(job_dict) == job_dict
Пример #4
0
def test_validate_error_with_string():
    """If given a string _validate_error() should return it wrapped in a dict.

    """
    assert db._validate_error("Something went wrong") == {
        "message": "Something went wrong"}
Пример #5
0
def test_validate_error_with_none():
    """_validate_error() should return None if given None."""
    assert db._validate_error(None) is None
Пример #6
0
def test_validate_error_with_valid_dict():
    """If given a valid dict _validate_error() should return the same dict."""
    job_dict = {"message": "Something went wrong"}
    assert db._validate_error(job_dict) == job_dict