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

40 lines
925 B

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