1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
from biplist import *
import os
from test_utils import *
import unittest
class TestInvalidPlistFile(unittest.TestCase):
def setUp(self):
pass
def testEmptyFile(self):
try:
readPlist(data_path('empty_file.plist'))
self.fail("Should not successfully read empty plist.")
except NotBinaryPlistException as e:
pass
except InvalidPlistException as e:
pass
def testTooShort(self):
try:
readPlistFromString(b"bplist0")
self.fail("Should not successfully read plist which is too short.")
except InvalidPlistException as e:
pass
def testInvalid(self):
try:
readPlistFromString(b"bplist0-------------------------------------")
self.fail("Should not successfully read invalid plist.")
except InvalidPlistException as e:
pass
if __name__ == '__main__':
unittest.main()
|