Skip to content

Commit fd2dcb7

Browse files
committed
Adding unit test for valid xdi file. Addressing the issue #2 .
1 parent 0a491c6 commit fd2dcb7

File tree

3 files changed

+660
-0
lines changed

3 files changed

+660
-0
lines changed

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from tests.test_WrongFields import *
44
from tests.test_MissingFields import *
55
from tests.test_MissingEndOfHeader import *
6+
from tests.test_ValidXDI import *
67

78
if __name__ == "__main__":
89
unittest.main(verbosity=2)

tests/test_ValidXDI.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import unittest
2+
from xdi_validator import validate
3+
4+
class TestValidXDI(unittest.TestCase):
5+
6+
7+
def setUp(self):
8+
9+
with open("tests/valid.xdi", "r") as valid_xdi:
10+
self.errors, self.data = validate(valid_xdi)
11+
12+
def tearDown(self):
13+
del self.errors
14+
del self.data
15+
16+
def test_valid(self):
17+
self.assertEqual(len(self.errors), 0)

0 commit comments

Comments
 (0)