Created unit test for rulings

This commit is contained in:
Nanda Scott 2018-10-23 12:41:38 -04:00
parent c7f5a83e3a
commit f136add3ed
1 changed files with 39 additions and 0 deletions

39
unittests/TestRulings.py Normal file
View File

@ -0,0 +1,39 @@
# This workaround makes sure that we can import from the parent dir
import sys
sys.path.append('..')
from scrython.rulings import Id
import unittest
import time
rules = Id(id='a985cfb0-6bae-4b1c-902e-d9d7a1aeec61')
class TestRulings(unittest.TestCase):
def test_data(self):
self.assertIsInstance(rules.data(), list)
def test_data_length(self):
self.assertIsInstance(rules.data_length(), int)
def test_has_more(self):
self.assertIsInstance(rules.has_more(), bool)
def test_object(self):
self.assertIsInstance(rules.object(), str)
def test_ruling_comment(self):
self.assertIsInstance(rules.ruling_comment(0), str)
def test_ruling_object(self):
self.assertIsInstance(rules.ruling_object(0), str)
def test_ruling_published_at(self):
self.assertIsInstance(rules.ruling_published_at(0), str)
def test_ruling_source(self):
self.assertIsInstance(rules.ruling_source(0), str)
if __name__ == '__main__':
unittest.main()