Commit Graph

7 Commits

Author SHA1 Message Date
Hugo van Kemenade 675afd8a92 Upgrade Python syntax with pyupgrade --py3-plus 2024-03-31 13:37:54 -07:00
Kurt Rose 40a7b47c6e
bugfix in mathutils.Bits.as_list (#315)
* bugfix in mathutils.Bits.as_list

list(Bits(0, 2)) == [False, False] -- which is the correct behavior
Bits(0, 2).as_list() == [False] -- which was a bug

* DRY internal function and avoid blowing up length in tests

* fix tests

* bytes and hex both pad to 1 byte so combine test

* fix roundtripping tests

---------

Co-authored-by: Mahmoud Hashemi <mahmoud@hatnote.com>
2023-02-19 22:17:43 -08:00
Mahmoud Hashemi b9a3042eca got Bits passing tox locally, had to make the hex be byte-resolution, not octet. need to document the destructive operation there. 2019-02-09 00:09:14 -08:00
Kurt Rose fa5452c383 adding Bits to mathutils 2019-01-29 23:22:38 -08:00
flopp d689c7ceef Fix spme spelling errors. 2018-10-11 15:11:30 -07:00
tiwo 230b856dc3 add some basic tests for clamp
these are expected to fail

* for Python 3, because the argument defaults (None) are incomparable
* for Python 2, because None<x for all ints and floats x, thus clamp(x)
  returns None
2017-06-18 14:53:48 +02:00
Mahmoud Hashemi 99dbb07c21 test module naming 2015-05-17 17:22:23 -07:00