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

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

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

revision 1585 by bh, Fri Aug 15 10:26:40 2003 UTC revision 1591 by bh, Fri Aug 15 14:00:53 2003 UTC
# Line 416  class TestBaseRenderer(unittest.TestCase Line 416  class TestBaseRenderer(unittest.TestCase
416                             ('EndDrawing',)])                             ('EndDrawing',)])
417    
418    
419        def test_point_with_classification(self):
420            """Test BaseRenderer with point layer and classification"""
421            table = MemoryTable([("type", FIELDTYPE_STRING),
422                                 ("value", FIELDTYPE_DOUBLE),
423                                 ("code", FIELDTYPE_INT)],
424                                [("UNKNOWN", 0.0, 0),
425                                 ("UNKNOWN", 0.0, 1)])
426            shapes = [[[(0, 0)]], [[(10, 10)]]]
427            store = SimpleShapeStore(SHAPETYPE_POINT, shapes, table)
428    
429            map = Map("TestBaseRenderer")
430            layer = Layer("point layer", store)
431            group = ClassGroupSingleton(1)
432            group.GetProperties().SetFill(Color(0, 0, 1))
433            layer.GetClassification().AppendGroup(group)
434            layer.SetClassificationColumn("code")
435    
436            map.AddLayer(layer)
437            self.to_destroy.append(map)
438    
439            dc = MockDC()
440            renderer = SimpleRenderer(dc, 2, (10, 10))
441    
442            renderer.render_map(map)
443    
444            self.assertEquals(dc.calls,
445                              [('BeginDrawing',),
446                               ('SetBrush', ('brush', Transparent)),
447                               ('SetPen', ('pen', Color(0, 0, 0), 1)),
448                               ('DrawEllipse', 5, 5, 10, 10),
449                               ('SetBrush', ('brush', Color(0, 0, 1))),
450                               ('SetPen', ('pen', Color(0, 0, 0), 1)),
451                               ('DrawEllipse', 25, -15, 10, 10),
452                               ('SetFont', "label font"),
453                               ('EndDrawing',)])
454    
455    
456  if __name__ == "__main__":  if __name__ == "__main__":
457      support.run_tests()      support.run_tests()

Legend:
Removed from v.1585  
changed lines
  Added in v.1591

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26