Correctly handle the presence of both an element and its toggle in the
input, and handle them base on order, e.g.
toggle_set(['x', 'y', '~x']) --> {'y', '~x'}
toggle_set(['~x', 'y', 'x']) --> {'y', 'x'}
- Change how "source" and "dest" are handled inside merge() to be more
sane and less confusing, ensuring that disabling toggles are merged
correctly.
- Do not drop disabling values during merge, to ensure that merging
is a transitive operation.
- Add unit tests for the above fixes.
- Add copyright headers to files that did not already have them
- Update the year to the last year the file was modified in files with
existing headers.
As part of commit #b3de85 porting to WA3, the behaviour of Enums changed
so that the attribute to be fetched is converted to lower case before
the lookup occurs. Due to the fact that 'names' is a predefined
attribute of the Enum class this clashes and will return the full list
of names instead of the individual entry. Update the test to use another
non reserved entry.
This should have been handled by the @total_ordering decorator, but
isn't due to
https://bugs.python.org/issue25732
(briefly, total_ordering is back-ported from Python 3, where the base
object provides the default implementation of __ne__ based on __eq__, so
total_ordering did not override it; this, however does not happen in
Python 2).
Also update unit tests to catch this edge case.
- What used to be enum.values is now enum.levels.
- Add enum.names and enum.values that are lists of enum's levels' names
and values respectively.
- Add a check on creation to make sure that provided level names do not
conflict with the atomatically created members.
Add to/from_pod implementations to level, so that it may be serialized
properly. In order to make sure that serialization is a reversible
operation, ensure that the level value is numeric.
Tests now reside in the root of the repo, rather than in wa package.
This means they will no longer packaged and installed in user
deployments (they're only useful for developers).