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