Menu

[r4592]: / trunk / toolkits / basemap / pyshapelib / testdbf.py  Maximize  Restore  History

Download this file

29 lines (21 with data), 710 Bytes

 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
# Copyright (C) 2003 by Intevation GmbH
# Authors:
# Bernhard Herzog <bh@intevation.de>
#
# This program is free software under the LGPL (>=v2)
# Read the file COPYING coming with the software for details.
"""Test cases for the dbflib python bindings"""
__version__ = "$Revision$"
# $Source$
# $Id$
import unittest
import dbflib
class TestDBF(unittest.TestCase):
def test_add_field(self):
"""Test whethe add_field reports exceptions"""
dbf = dbflib.create("test.dbf")
# For strings the precision parameter must be 0
self.assertRaises(RuntimeError,
dbf.add_field, "str", dbflib.FTString, 10, 5)
if __name__ == "__main__":
unittest.main()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.