A free and open source alternative ekşi sözlük front-end
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ozgursozluk/tests.py

41 lines
925 B

1 year ago
import unittest
11 months ago
from ozgursozluk.scraper import EksiSozluk
1 year ago
1 year ago
es = EksiSozluk()
11 months ago
topic = es.get_topic("linux--32084")
1 year ago
entry = es.get_entry(1)
1 year ago
class TestTopic(unittest.TestCase):
def test_topic_id(self):
self.assertEqual(topic.id, 32084)
1 year ago
def test_topic_title(self):
self.assertEqual(topic.title, "linux")
1 year ago
def test_topic_path(self):
self.assertEqual(topic.path, "linux--32084")
1 year ago
class TestEntry(unittest.TestCase):
def test_topic_id(self):
self.assertEqual(entry.topic_id, 31782)
1 year ago
def test_topic_title(self):
self.assertEqual(entry.topic_title, "pena")
1 year ago
def test_topic_path(self):
self.assertEqual(entry.topic_path, "pena--31782")
1 year ago
def test_entry_author(self):
self.assertEqual(entry.author, "ssg")
1 year ago
def test_entry_datetime(self):
self.assertEqual(entry.datetime, "15.02.1999")
1 year ago
if __name__ == "__main__":
unittest.main()