@@ -37,7 +37,22 @@ class TestMissingNoticeBot(unittest.TestCase):
|
||||
"""
|
||||
Test class MissingNoticeBot
|
||||
"""
|
||||
pass
|
||||
|
||||
@mock.patch( 'sqlalchemy.engine.Engine.execute',
|
||||
return_value=( { "page_title": b"a", },
|
||||
{ "page_title": b"b", },
|
||||
{ "page_title": b"c", },
|
||||
{ "page_title": b"d", }, ) )
|
||||
def test_get_categorized_articles(self, execute_mock):
|
||||
"""
|
||||
Test method get_categorized_articles()
|
||||
"""
|
||||
self.assertFalse(execute_mock.called)
|
||||
|
||||
result = MissingNoticeBot.get_categorized_articles()
|
||||
|
||||
self.assertTrue(execute_mock.called)
|
||||
self.assertEqual(result, ["a", "b", "c", "d"] )
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user