| 293 | #### |
| 294 | |
| 295 | class Test( object ): |
| 296 | ro_value = Property( 'ro_value', 'test', mode = Property.Mode.READ_ONLY ) |
| 297 | |
| 298 | assertException( ValueError, lambda: Property( 'ro_undef', mode = Property.Mode.READ_ONLY ), |
| 299 | 'read-only attributes should require default' ) |
| 300 | |
| 301 | rw_undef = Property( 'rw_undef' ) |
| 302 | rw_default = Property( 'rw_default', None ) |
| 303 | rw_doc = Property( 'rw_default', doc = 'alternate documentation' ) |
| 304 | |
| 305 | assertException( TypeError, lambda: Property( 'bad_mode', mode = None ), |
| 306 | 'bad Property mode should raise an exception' ) |
| 307 | |
| 308 | wo_undef = Property( 'wo_undef', mode = Property.Mode.WRITE_ONCE ) |
| 309 | wo_default = Property( 'wo_default', 'test', mode = Property.Mode.WRITE_ONCE ) |
| 310 | |
| 311 | a = Test() |
| 312 | b = Test() |
no test coverage detected