Commit Graph

23 Commits

Author SHA1 Message Date
Edouard Choinière
95cafd1a3f style: Normalise numpy imports with import numpy as np
The convention when importing numpy is to use `import numpy as np`

Fixes: unconventional-import-alias (ICN001)
Ruff rule: https://docs.astral.sh/ruff/rules/unconventional-import-alias/
2025-02-08 16:48:57 +00:00
Scott Talbert
8fc9c03ac8 tests: skip test_gdicmn test that currently fails 2022-01-02 13:53:16 -05:00
Stefan Brüns
7015096786 Fix tests, current wxWidgets uses rounding for wxPoint from real
Since wxWigets 3.1.2, several wxPoint/wxRealPoint/wxSize operations
no longer truncate results and do correct rounding. Reflect this in
the expected results.
2020-07-30 02:52:29 +02:00
Robin Dunn
f21c6b812d Add tests for floating point multiplication of Point, Size and RealPoint
(cherry picked from commit 46cc86a34a)
2018-09-25 12:44:35 -07:00
Robin Dunn
efa81882e3 Also allow numpy arrays for sequence conversions to value types 2017-04-17 17:22:50 -07:00
Robin Dunn
52facb4d7f Add a GetIM() method to Colour, Point, Size, Rect and other ‘value’ types.
GetIM() returns a replicant of the original object that is immutable, so it can be used as a dictionary key, or etc., but still gives access to the properties by name, which using the Get() method to get a tuple of the values does not do.
2017-04-14 19:19:26 -07:00
Robin Dunn
5d7b9e6b17 Don’t test with the == operators, that will be changing in a different way in another PR 2017-04-12 16:55:22 -07:00
Robin Dunn
b01729f4ef Tighten up allowed types in auto sequence conversions
Instead of allowing generic sequences to be convertible to wxPoint, wxSize, and others, explicitly allow only tuples and lists.  This is needed because these types also have methods that make them look like sequences, which meant that you could pass a wxSize where a wxPoint is expected, and so on.

Even worse is nonsense stuff like:

    wx.Point(10,20) == wx.Size(10,20)

evaluating to True.
2017-04-12 13:57:08 -07:00
Metallicow
9568103974 Trim trailing space unittests directory 2016-12-05 16:19:11 -06:00
Robin Dunn
bb01dc0d7f Use absolute import of wtc in the unittest modules, instead of depending on them being run as __main__ and getting the folder on the sys.path by default. 2016-06-30 16:49:19 -07:00
Robin Dunn
4f38ee259d Remove imp_unittest 2016-05-07 19:16:28 -07:00
Robin Dunn
157c2a43e0 fix test assertion 2016-02-22 21:07:17 -08:00
Robin Dunn
70729b25f6 Fix != comparison for gdicmn classes. Fixes #15772
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-11 03:32:49 +00:00
Robin Dunn
00c2a11514 Add and test wx.IntersectRect()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-15 07:28:37 +00:00
Robin Dunn
6291fd7cc9 Present the math operators for Point, Size, Rect as if they were methods of the class instead of global functions. This helps disambiguate between Point and Size functions due to how both can be equivalent to 2-element sequences.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-29 02:33:14 +00:00
Robin Dunn
a548f7224d unittest updates and new test modules
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-15 16:16:21 +00:00
Robin Dunn
5e89a9606d Change the package name from wxPhoenix to wx
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@68979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-03 02:39:18 +00:00
Robin Dunn
4219e02440 * move wxPen to etg/pen.py
* move wxBrush to etg/brush.py
* move wxBookCtrlBase and wxBookCtrlEvent to etg/bookctrl.py
* move wxBitmapButton to etg/bmpbuttn.py
* move wxArrayString MappedType and add wxArrayInt plus some unittests
* add checking for default values for pos and size parameters in fixWindowClass
* set out parameter flags for wxImageHistogram.FindFirstUnusedColour
* Restore layout constraints classes and related methods
* Create a MappedType for wxClientData
* update used of wxClientData in wx.CommandEvent
* Move wxControlWithItems, wxItemContainer and wxControlWithItems to etg/ctrlsub.py
* enable some Append, Insert and Set overloads in wxControlWithItems
* addGetterSetterProps: don't make setter-only properties
* addGetterSetterProps: ensure that the getter can be called with zero args
* addGetterSetterProps: ensure that the setter can be called with just 1 arg
* restore version checking code
* moved DC classes to other etg files to match interface file names.
* allow both overloads for wx.DC.GetTextExtent and GetMultiLineTextExtent by renaming 1
* add wx.DC.GetPartialTextExtents
* and some other stuff

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@68975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-03 01:42:42 +00:00
Robin Dunn
96717983ad A boatload of changes and additions, all my Phoenix work for the past few days. Lots of lower level classes are wrapped, wxApp is working up through OnInit, plus there's a good start on some unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-27 08:53:17 +00:00
Robin Dunn
b77539c5db new unit tests
git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-18 08:17:40 +00:00
Robin Dunn
b9e74764ec More properties, magic methods and unit tests for gdicmn
git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-14 07:57:09 +00:00
Robin Dunn
24c86126d9 Add magic methods to wx.Size and add unit tests for wx.Size. Also a bit of related refactoring and cleanup.
git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66147 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-14 01:29:52 +00:00
Robin Dunn
36e09a96ad Unit tests for wx.Point
git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66135 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-13 08:15:40 +00:00