コード例 #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
ファイル: test_db.py プロジェクト: ckan/ckan-service-provider
def test_validate_error_with_none():
    """_validate_error() should return None if given None."""
    assert db._validate_error(None) is None
コード例 #3
0
ファイル: test_db.py プロジェクト: ckan/ckan-service-provider
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
ファイル: test_db.py プロジェクト: ckan/ckan-service-provider
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