Skip to content

Commit 6754910

Browse files
committed
added initial tests
1 parent bce9059 commit 6754910

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

tests/test_parse.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
import os
2-
from unittest import TestCase
32
import sys
4-
sys.path.insert(0, os.path.abspath('..'))
3+
sys.path.insert(0, os.path.abspath('python-xbrl'))
4+
import pytest
55

6-
import six
6+
try:
7+
from StringIO import StringIO
8+
except ImportError:
9+
from io import StringIO
710

811
from parser import soup_maker, XBRLParser, XBRLParserException
912

10-
class TestParse(TestCase):
13+
class TestParse():
1114

1215
def testEmptyFile(self):
13-
fh = six.BytesIO(six.b(""))
14-
self.assertRaises(XBRLParserException, XBRLParser.parse, fh)
16+
fh = StringIO()
17+
assert XBRLParser.parse(fh) is None
1518

16-
#def test_parse(self):
17-
# make sure the shuffled sequence does not lose any elements
18-
19-
20-
if __name__ == '__main__':
21-
unittest.main()

0 commit comments

Comments
 (0)