def test_deleted(self): self.assertEqual( classifier.get_comments([ make_comment_event(1, 'aaa', 'msg', 2016), make_comment_event(1, None, None, None, action='deleted'), make_comment_event(2, '', '', '', action='deleted') ]), [])
def test_basic(self): self.assertEqual( classifier.get_comments( [make_comment_event(1, 'aaa', 'msg', ts=2016)]), [{ 'author': 'aaa', 'comment': 'msg', 'timestamp': 2016 }])
def test_edited(self): self.assertEqual( classifier.get_comments([ make_comment_event(1, 'aaa', 'msg', ts=2016), make_comment_event(1, 'aaa', 'redacted', ts=2016.1, action='edited') ]), [{ 'author': 'aaa', 'comment': 'redacted', 'timestamp': 2016.1 }])
def test_edited(self): self.assertEqual(classifier.get_comments([ make_comment_event(1, 'aaa', 'msg', ts=2016), make_comment_event(1, 'aaa', 'redacted', ts=2016.1, action='edited')]), [{'id': 1, 'author': 'aaa', 'comment': 'redacted', 'timestamp': 2016.1}])
def test_deleted(self): self.assertEqual(classifier.get_comments([ make_comment_event(1, 'aaa', 'msg', 2016), make_comment_event(1, None, None, None, action='deleted'), make_comment_event(2, '', '', '', action='deleted')]), [])
def test_basic(self): self.assertEqual(classifier.get_comments([make_comment_event(1, 'aaa', 'msg', ts=2016)]), [{'id': 1, 'author': 'aaa', 'comment': 'msg', 'timestamp': 2016}])