Beispiel #1
0
def test_response_body_release_id_semantic_without_version():
    assert healthpy.response_body(healthpy.pass_status,
                                  release_id="1.2.3") == {
                                      "status": "pass",
                                      "releaseId": "1.2.3",
                                      "version": "1",
                                  }
Beispiel #2
0
def test_response_body_links():
    assert healthpy.response_body(healthpy.pass_status,
                                  links={"http://key": "http://value"}) == {
                                      "status": "pass",
                                      "links": {
                                          "http://key": "http://value"
                                      },
                                  }
Beispiel #3
0
def test_response_body_release_id_non_semantic_with_version():
    assert healthpy.response_body(healthpy.pass_status,
                                  version="2",
                                  release_id="1") == {
                                      "status": "pass",
                                      "releaseId": "1",
                                      "version": "2",
                                  }
Beispiel #4
0
def test_response_body_service_id():
    assert healthpy.response_body(healthpy.pass_status, service_id="test") == {
        "status": "pass",
        "serviceId": "test",
    }
Beispiel #5
0
def test_default_warn_response_body():
    assert healthpy.response_body(healthpy.warn_status) == {
        "status": "warn",
    }
Beispiel #6
0
def test_response_body_checks():
    assert healthpy.response_body(healthpy.pass_status, checks={}) == {
        "status": "pass",
        "checks": {},
    }
Beispiel #7
0
def test_response_body_output():
    assert healthpy.response_body(healthpy.pass_status,
                                  output="test output") == {
                                      "status": "pass",
                                      "output": "test output",
                                  }
Beispiel #8
0
def test_response_body_notes():
    assert healthpy.response_body(healthpy.pass_status,
                                  notes=["note 1", "note 2"]) == {
                                      "status": "pass",
                                      "notes": ["note 1", "note 2"],
                                  }
Beispiel #9
0
def test_default_pass_response_body():
    assert healthpy.response_body(healthpy.pass_status) == {
        "status": "pass",
    }
Beispiel #10
0
def test_response_body_version():
    assert healthpy.response_body(healthpy.pass_status, version="1") == {
        "status": "pass",
        "version": "1",
    }
Beispiel #11
0
def test_default_fail_response_body():
    assert healthpy.response_body(healthpy.fail_status) == {
        "status": "fail",
    }
Beispiel #12
0
def test_response_body_description():
    assert healthpy.response_body(healthpy.pass_status,
                                  description="test description") == {
                                      "status": "pass",
                                      "description": "test description",
                                  }