Added length property and TestCase.

This commit is contained in:
sv-ncp-3 root 2014-09-15 17:33:41 +02:00
parent e014969ff1
commit 62e5aeeaff
2 changed files with 15 additions and 0 deletions

View File

@ -4,6 +4,7 @@
class IPTCMessage(object):
def __init__(self, raw):
self.raw = raw
self.length = len(self.raw)
print("Message: %s" % repr(self.raw))
if __name__=='__main__':

14
iptcmessageTest.py Executable file
View File

@ -0,0 +1,14 @@
#!/bin/env python3
# -*- coding: utf-8 -*-
import iptcmessage
import unittest
class IPTCMessageTestCase(unittest.TestCase):
def testMessageParsing(self):
iptc = iptcmessage.IPTCMessage("")
self.assertGreater(iptc.length, 0)
if __name__=='__main__':
unittest.main()