Esempio n. 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"
    }
Esempio n. 2
0
def test_validate_error_with_none():
    """_validate_error() should return None if given None."""
    assert db._validate_error(None) is None
Esempio n. 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
Esempio n. 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"}
Esempio n. 5
0
def test_validate_error_with_none():
    """_validate_error() should return None if given None."""
    assert db._validate_error(None) is None
Esempio n. 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