server: treat missing moods (from older clients) as "quiet"
This commit is contained in:
parent
4f0dde9529
commit
47d3eee6fe
|
@ -318,9 +318,9 @@ class Channel:
|
||||||
return (started, "pruney", total_time, None)
|
return (started, "pruney", total_time, None)
|
||||||
|
|
||||||
# ok, both sides closed. figure out the mood
|
# ok, both sides closed. figure out the mood
|
||||||
A_mood = A_deallocs[0]["body"]
|
A_mood = A_deallocs[0]["body"] # maybe None
|
||||||
B_mood = B_deallocs[0]["body"]
|
B_mood = B_deallocs[0]["body"] # maybe None
|
||||||
mood = "errory"
|
mood = "quiet"
|
||||||
if A_mood == u"happy" and B_mood == u"happy":
|
if A_mood == u"happy" and B_mood == u"happy":
|
||||||
mood = "happy"
|
mood = "happy"
|
||||||
if A_mood == u"lonely" or B_mood == u"lonely":
|
if A_mood == u"lonely" or B_mood == u"lonely":
|
||||||
|
|
|
@ -413,3 +413,13 @@ class Summary(unittest.TestCase):
|
||||||
(1, "scary", 40, 9))
|
(1, "scary", 40, 9))
|
||||||
self.failUnlessEqual(c._summarize(make_moods("scary", "errory"), 41),
|
self.failUnlessEqual(c._summarize(make_moods("scary", "errory"), 41),
|
||||||
(1, "scary", 40, 9))
|
(1, "scary", 40, 9))
|
||||||
|
|
||||||
|
# older clients don't send a mood
|
||||||
|
self.failUnlessEqual(c._summarize(make_moods(None, None), 41),
|
||||||
|
(1, "quiet", 40, 9))
|
||||||
|
self.failUnlessEqual(c._summarize(make_moods(None, "happy"), 41),
|
||||||
|
(1, "quiet", 40, 9))
|
||||||
|
self.failUnlessEqual(c._summarize(make_moods(None, "happy"), 41),
|
||||||
|
(1, "quiet", 40, 9))
|
||||||
|
self.failUnlessEqual(c._summarize(make_moods(None, "scary"), 41),
|
||||||
|
(1, "scary", 40, 9))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user