from arrange_schedule import *


def test_read_system_setting():
    keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
    system_setting = read_system_setting()
    for key in keys:
        assert key in system_setting
    return system_setting

def test_read_arrange_mode():
    keys = ['arrange_sn','arrange_mode','condition']
    receive_msg = read_arrange_mode()
    for key in keys:
        assert key in receive_msg

def test_crawler_cwb_img(system_setting):
    send_msg = {}
    send_msg['server_dir'] = system_setting['board_py_dir']
    send_msg['user_id'] = 1

    receive_msg = crawler_cwb_img(send_msg)
    assert receive_msg['result'] == 'success'

if __name__ == "__main__":
    system_setting = test_read_system_setting()
    test_read_arrange_mode()
    test_crawler_cwb_img(system_setting)
    print("All test passed")

@@ -673,16 +673,380 @@
 ccess'%0A%0A
+def test_crawler_inside_img():%0A    receive_msg = crawler_inside_news()%0A    assert receive_msg%5B'result'%5D == 'success'%0A%0Adef test_crawler_techorange_news():%0A    receive_msg = crawler_techorange_news()%0A    assert receive_msg%5B'result'%5D == 'success'%0A%0Adef test_crawler_medium_news():%0A    receive_msg = crawler_medium_news()%0A    assert receive_msg%5B'result'%5D == 'success'%0A%0A
 if __nam
@@ -1182,16 +1182,112 @@
 etting)%0A
+    test_crawler_inside_img()%0A    test_crawler_techorange_news()%0A    test_crawler_medium_news()%0A
     prin

Add test case for forum crawler