| 2401 | |
| 2402 | |
| 2403 | class OrderTraits(HasTraits): |
| 2404 | notified = Dict() |
| 2405 | |
| 2406 | a = Unicode() |
| 2407 | b = Unicode() |
| 2408 | c = Unicode() |
| 2409 | d = Unicode() |
| 2410 | e = Unicode() |
| 2411 | f = Unicode() |
| 2412 | g = Unicode() |
| 2413 | h = Unicode() |
| 2414 | i = Unicode() |
| 2415 | j = Unicode() |
| 2416 | k = Unicode() |
| 2417 | l = Unicode() # noqa: E741 |
| 2418 | |
| 2419 | def _notify(self, name, old, new): |
| 2420 | """check the value of all traits when each trait change is triggered |
| 2421 | |
| 2422 | This verifies that the values are not sensitive |
| 2423 | to dict ordering when loaded from kwargs |
| 2424 | """ |
| 2425 | # check the value of the other traits |
| 2426 | # when a given trait change notification fires |
| 2427 | self.notified[name] = {c: getattr(self, c) for c in "abcdefghijkl"} |
| 2428 | |
| 2429 | def __init__(self, **kwargs): |
| 2430 | self.on_trait_change(self._notify) |
| 2431 | super().__init__(**kwargs) |
| 2432 | |
| 2433 | |
| 2434 | def test_notification_order(): |
searching dependent graphs…