Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
Enh: Handle id rename in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Coavoux committed Sep 24, 2015
1 parent a4ea830 commit 52a81c6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/test_livestatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
class LiveStatusTest(TestConfig):
def setUp(self):
self.setup_with_file('etc/shinken_1r_1h_1s.cfg')
Comment.id = 1
if hasattr(Comment, "_id"):
Comment._id = 1
else:
Comment.id = 1
self.testid = str(os.getpid() + random.randint(1, 1000))
self.init_livestatus()
print "Cleaning old broks?"
Expand Down Expand Up @@ -830,8 +833,8 @@ def test_thruk_comments(self):
ResponseHeader: fixed16\n"""
response, _ = self.livestatus_broker.livestatus.handle_request(request)
good_response = """200 115
[["(Nagios Process)",2,0,0,"test_host_0",1,0,"test_ok_0",0,2],["lausser",1,0,0,"test_host_0",2,1,"test_ok_0",1,2]]
"""
[["(Nagios Process)",2,0,0,"test_host_0",%d,0,"test_ok_0",0,2],["lausser",1,0,0,"test_host_0",%d,1,"test_ok_0",1,2]]
""" % (self.sched.comments[1].id, self.sched.comments[2].id)
print "request", request
print "response", response
print "goodresp", good_response
Expand Down

0 comments on commit 52a81c6

Please sign in to comment.