Skip to content

Commit

Permalink
Added new test for B1. Added test for RegistroDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaume Florez committed Oct 5, 2016
1 parent b01bad9 commit 41632c0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_switching.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,30 @@ def test_accept_no_cond_cont(self):
assert a301_no_text_xml.contracte.condicions is False


class SwitchingB1Test(unittest.TestCase):
"""test de B1"""

def setUp(self):
sup = supportClass
self.xml_b101 = open(get_data("b101.xml"), "r")
self.xml_b101_regdoc = open(get_data("b101_RegistroDoc.xml"), "r")

def test_read_m101_regdoc(self):
b101_xml = M1(self.xml_b101_regdoc)
b101_xml.set_xsd()
b101_xml.parse_xml()
documents = b101_xml.documents
assert len(documents) > 0
doc = documents[0]
assert doc.doc_type == '08'
assert doc.url == 'http://eneracme.com/docs/NIF11111111H.pdf'
b101_xml = M1(self.xml_b101)
b101_xml.set_xsd()
b101_xml.parse_xml()
documents = b101_xml.documents
assert documents == []


class SwitchingM1Test(unittest.TestCase):
"""test de M1"""

Expand Down

0 comments on commit 41632c0

Please sign in to comment.