Skip to content
Snippets Groups Projects
Unverified Commit 0ee5b967 authored by Seok Won's avatar Seok Won
Browse files

isort everything

parent 1d5a67d1
No related branches found
No related tags found
No related merge requests found
import json
import time
import os
import time
from config import Config
from confluent_kafka import Consumer, KafkaError
......
from confluent_kafka import Producer
from config import Config
from contextlib import contextmanager
from config import Config
from confluent_kafka import Producer
@contextmanager
def prod(settings):
......
from confluent_kafka import Producer
from config import Config
from confluent_kafka import Producer
def acked(err, msg):
......
import json
import time
import os
import time
from confluent_kafka import Consumer, KafkaError
from slack import WebClient
......
import json
import time
import os
import time
from config import Config
from confluent_kafka import Producer
......
import mysql.connector
import os
from contextlib import contextmanager
import mysql.connector
import requests
from bs4 import BeautifulSoup
from contextlib import contextmanager
import os
# mysql.connector.paramstyle = "pyformat"
ADDRESS = "https://www.ajou.ac.kr/kr/ajou/notice.do"
......
import json
import os
from contextlib import contextmanager
from pathlib import Path
from datetime import datetime, timedelta
from pathlib import Path
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
JSON_PATH = os.path.join(BASE_DIR, "test.json")
......@@ -61,3 +61,17 @@ def test_remove():
currentDate = read["POSTS"][post]["DATE"] # string
savedDate = datetime.strptime(currentDate, "%y.%m.%d")
assert savedDate > old, f"{MAXIMUM_DAY}일이 지난 공지는 제거되어야 함."
def test_length():
with open(JSON_PATH, "r+") as f_read:
read = json.load(f_read)
lengths = 0
seen = 0
for post in read["POSTS"]:
seen += 1
lengths += len(read["POSTS"][post]["TITLE"])
print(lengths / seen)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment