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')
         ]), [])
Пример #2
0
 def test_basic(self):
     self.assertEqual(
         classifier.get_comments(
             [make_comment_event(1, 'aaa', 'msg', ts=2016)]),
         [{
             'author': 'aaa',
             'comment': 'msg',
             'timestamp': 2016
         }])
Пример #3
0
 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
         }])
Пример #4
0
 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}])
Пример #5
0
 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')]),
         [])
Пример #6
0
 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}])