Exemple #1
0
 def toEdi(self):
     assert (self.tag is not None)
     message = PMessage()
     tag, elements = self.tag, self.toList()
     segment = PSegment(tag, None)
     if elements is not None and len(elements) > 0:
         segment = PSegment(tag, *elements)
     message.add_segment(segment)
     return message.serialize()
Exemple #2
0
def test_empty_segment_list():
    m = Message()
    assert m.serialize() == ""
Exemple #3
0
def test_UNA_integrity2():
    m = Message()
    initstring = ":+.? '"
    m.add_segment(Segment("UNA", initstring))
    assert m.serialize() == "UNA" + initstring