-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
33 lines (24 loc) · 1.07 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from unittest import TestCase
import ilcs
class ILCSSectionTestCase(TestCase):
def test_comparison(self):
s1 = ilcs.ILCSSection(chapter="5", act_prefix="20", section="1")
s2 = ilcs.ILCSSection(chapter="5", act_prefix="20", section="1")
self.assertEqual(s1, s2)
def test_str(self):
s1 = ilcs.ILCSSection(chapter="5", act_prefix="20", section="1")
self.assertEqual(str(s1), "5 ILCS 20/1")
class ILRSSectionTestCase(TestCase):
def test_replace_half_chapters(self):
s = ilcs.ILRSSection(chapter="56.5", paragraph="704")
self.assertEqual(s.chapter, "56 1/2")
class ModuleGlobalsTestCase(TestCase):
def test_sections_auto_loaded(self):
self.assertEqual(len(ilcs.sections), 45561)
def test_lookup_by_ilrs(self):
sections = ilcs.lookup_by_ilrs(chapter="1", paragraph="100")
self.assertEqual(len(sections), 1)
section = sections[0]
self.assertEqual(section.chapter, "5")
self.assertEqual(section.act_prefix, "20")
self.assertEqual(section.section, "0.01")