PearsonEducation / Alarmageddon

Full-stack monitoring and alerting Python library.
Other
15 stars 10 forks source link

json less then expiation missing JSON property #9

Closed curtisallen closed 9 years ago

curtisallen commented 9 years ago

While developing a storm validator, I noticed this bug that is better summed up with this test https://github.com/curtisallen/Alarmageddon/commit/2792db23b6f2459d283713d70a93a5d0119de10f

def test_get_json_value_less_than_zero(httpserver):
    httpserver.serve_content(code=200,
                             headers={"content-type": "application/json"},
                             content='{"mode": "NORMAL","failed":0}')
    (HttpValidation.get(httpserver.url)
     .expect_json_property_value_less_than("failed", 2)
     .perform({}))

Will produce ValidationFailure: 'missing JSON property failed' this should pass. Haven't started looking at a solution but I may take a crack at it.

timjstewart commented 9 years ago

Hi Curtis! Thanks for the Issue and the failing test. I found the problem and will be checking a fix into the dev branch momentarily.

timjstewart commented 9 years ago

You're test is passing now. Please let me know if you have any other problems with Alarmageddon.

curtisallen commented 9 years ago

Awesome thanks so much!