32 |
from Thuban.Model.proj import Projection |
from Thuban.Model.proj import Projection |
33 |
from Thuban.Model.data import DerivedShapeStore |
from Thuban.Model.data import DerivedShapeStore |
34 |
from Thuban.Model.classification import Classification, ClassGroupSingleton, \ |
from Thuban.Model.classification import Classification, ClassGroupSingleton, \ |
35 |
ClassGroupRange |
ClassGroupRange, ClassGroupPattern |
36 |
from Thuban.Model.color import Color |
from Thuban.Model.color import Color |
37 |
|
|
38 |
import Thuban.Model.resource |
import Thuban.Model.resource |
416 |
# the layer. |
# the layer. |
417 |
self.failIf(self.layer.WasModified()) |
self.failIf(self.layer.WasModified()) |
418 |
|
|
419 |
def test_set_classification(self): |
def test_set_classification_numerical(self): |
420 |
"""Test Layer.SetClassification""" |
"""Test Layer.SetClassification numerical""" |
421 |
classification = Classification() |
classification = Classification() |
422 |
classification.AppendGroup(ClassGroupRange((0.0, 0.1))) |
classification.AppendGroup(ClassGroupRange((0.0, 0.1))) |
423 |
|
|
437 |
|
|
438 |
self.check_messages([(self.layer, LAYER_CHANGED)]) |
self.check_messages([(self.layer, LAYER_CHANGED)]) |
439 |
self.failUnless(self.layer.WasModified()) |
self.failUnless(self.layer.WasModified()) |
440 |
|
|
441 |
|
def test_set_classification_textual(self): |
442 |
|
"""Test Layer.SetClassification textual""" |
443 |
|
classification = Classification() |
444 |
|
classification.AppendGroup(ClassGroupPattern("I")) |
445 |
|
|
446 |
|
self.layer.SetClassification(classification) |
447 |
|
self.layer.SetClassificationColumn("POPYCOUN") |
448 |
|
|
449 |
|
self.check_messages([(self.layer, LAYER_CHANGED), |
450 |
|
(self.layer, LAYER_CHANGED)]) |
451 |
|
self.failUnless(self.layer.WasModified()) |
452 |
|
|
453 |
|
self.clear_messages() |
454 |
|
self.layer.UnsetModified() |
455 |
|
|
456 |
|
# change only the classification column. This should issue a |
457 |
|
# LAYER_CHANGED message as well. |
458 |
|
self.layer.SetClassificationColumn("POPYREG") |
459 |
|
|
460 |
|
self.check_messages([(self.layer, LAYER_CHANGED)]) |
461 |
|
self.failUnless(self.layer.WasModified()) |
462 |
|
|
463 |
|
|
464 |
def test_tree_info(self): |
def test_tree_info(self): |