/[thuban]/branches/WIP-pyshapelib-bramz/test/test_classification.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/test_classification.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1437 by jonathan, Wed Jul 16 13:25:16 2003 UTC revision 1898 by bh, Fri Oct 31 14:38:09 2003 UTC
# Line 35  from Thuban.Model.range import Range Line 35  from Thuban.Model.range import Range
35  import copy  import copy
36    
37    
38  class TestClassification(unittest.TestCase):  class TestClassGroupProperties(unittest.TestCase):
39    
40      def test_ClassGroupProperties(self):      def test(self):
41          """Test ClassGroupProperties"""          """Test ClassGroupProperties"""
42    
43          props = ClassGroupProperties()          props = ClassGroupProperties()
# Line 64  class TestClassification(unittest.TestCa Line 64  class TestClassification(unittest.TestCa
64          self.assertNotEqual(newProps1, props)          self.assertNotEqual(newProps1, props)
65          self.assertEqual(newProps1, newProps2)          self.assertEqual(newProps1, newProps2)
66    
67      def test_ClassGroup(self):  
68    class TestClassGroup(unittest.TestCase):
69    
70        def test(self):
71          """Test ClassGroup"""          """Test ClassGroup"""
72    
73          # test constructor with no label          # test constructor with no label
# Line 94  class TestClassification(unittest.TestCa Line 97  class TestClassification(unittest.TestCa
97          # test GetProperties...also a virtual function          # test GetProperties...also a virtual function
98          #self.assertEqual(group.GetProperties(), None)          #self.assertEqual(group.GetProperties(), None)
99    
100      def test_ClassGroupDefault(self):  
101    class TestClassGroupDefault(unittest.TestCase):
102    
103        def test(self):
104          """Test ClassGroupDefault"""          """Test ClassGroupDefault"""
105    
106          defProps = ClassGroupProperties()          defProps = ClassGroupProperties()
# Line 134  class TestClassification(unittest.TestCa Line 140  class TestClassification(unittest.TestCa
140          groupCopy = copy.copy(group)          groupCopy = copy.copy(group)
141          self.assertEqual(group, groupCopy)          self.assertEqual(group, groupCopy)
142    
143      def test_ClassGroupRange(self):  
144    class TestClassGroupRange(unittest.TestCase):
145    
146        def test(self):
147          """Test ClassGroupRange"""          """Test ClassGroupRange"""
148    
149          defProps = ClassGroupProperties()          defProps = ClassGroupProperties()
# Line 150  class TestClassification(unittest.TestCa Line 159  class TestClassification(unittest.TestCa
159          self.assertEqual(group.GetMax(), 1)          self.assertEqual(group.GetMax(), 1)
160          self.assertEqual(group.GetProperties(), defProps)          self.assertEqual(group.GetProperties(), defProps)
161          self.assertEqual(group.GetLabel(), "")          self.assertEqual(group.GetLabel(), "")
162            
163          # test SetMax()          # test SetMax()
164          self.assertRaises(ValueError, group.SetMax, 0)          self.assertRaises(ValueError, group.SetMax, 0)
165          self.assertRaises(ValueError, group.SetMax, -1)          self.assertRaises(ValueError, group.SetMax, -1)
# Line 187  class TestClassification(unittest.TestCa Line 196  class TestClassification(unittest.TestCa
196          groupCopy = copy.copy(group)          groupCopy = copy.copy(group)
197          self.assertEqual(group, groupCopy)          self.assertEqual(group, groupCopy)
198    
199      def test_ClassGroupSingleton(self):  
200    class TestClassGroupSingleton(unittest.TestCase):
201    
202        def test(self):
203          """Test ClassGroupSingleton"""          """Test ClassGroupSingleton"""
204    
205          defProps = ClassGroupProperties()          defProps = ClassGroupProperties()
# Line 232  class TestClassification(unittest.TestCa Line 244  class TestClassification(unittest.TestCa
244          # test copy          # test copy
245          groupCopy = copy.copy(group)          groupCopy = copy.copy(group)
246          self.assertEqual(group, groupCopy)          self.assertEqual(group, groupCopy)
           
247    
248      def test_ClassIterator(self):  
249    class TestClassIterator(unittest.TestCase):
250    
251        def test(self):
252          """Test ClassIterator"""          """Test ClassIterator"""
253    
254          groups = [ClassGroupSingleton(5), ClassGroupSingleton(5),          groups = [ClassGroupSingleton(5), ClassGroupSingleton(5),
# Line 257  class TestClassification(unittest.TestCa Line 271  class TestClassification(unittest.TestCa
271    
272          self.assertEquals(list, [0, 1, 1, 2, 1, 0])          self.assertEquals(list, [0, 1, 1, 2, 1, 0])
273    
274      def test_classification(self):  
275    class TestClassification(unittest.TestCase):
276    
277        def test(self):
278          """Test Classification"""          """Test Classification"""
279    
280          defProps = ClassGroupProperties()          defProps = ClassGroupProperties()
# Line 310  class TestClassification(unittest.TestCa Line 327  class TestClassification(unittest.TestCa
327          session.Destroy()          session.Destroy()
328          layer.Destroy()          layer.Destroy()
329    
330    
331  if __name__ == "__main__":  if __name__ == "__main__":
332      support.run_tests()      support.run_tests()

Legend:
Removed from v.1437  
changed lines
  Added in v.1898

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26