Skip to content

Commit

Permalink
Add skip testbed handlers for icon buttons on Android, GTK, and Winfo…
Browse files Browse the repository at this point in the history
…rms.
  • Loading branch information
freakboy3742 committed Dec 31, 2023
1 parent 8c422fa commit 58c0dc8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions android/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from java import jclass

from toga.colors import TRANSPARENT
Expand All @@ -16,3 +17,9 @@ class ButtonProbe(LabelProbe):
def background_color(self):
color = super().background_color
return None if color == TRANSPARENT else color

def assert_no_icon(self):
pytest.skip("Android doesn't support icons on buttons")

def assert_icon_size(self):
pytest.skip("Android doesn't support icons on buttons")
8 changes: 8 additions & 0 deletions gtk/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from toga.colors import TRANSPARENT
from toga_gtk.libs import Gtk

Expand All @@ -11,6 +13,12 @@ class ButtonProbe(SimpleProbe):
def text(self):
return self.native.get_label()

def assert_no_icon(self):
pytest.skip("GTK doesn't support icons on buttons")

def assert_icon_size(self):
pytest.skip("GTK doesn't support icons on buttons")

@property
def background_color(self):
color = super().background_color
Expand Down
7 changes: 7 additions & 0 deletions winforms/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
import System.Windows.Forms
from System.Drawing import SystemColors

Expand All @@ -16,6 +17,12 @@ def text(self):
return ""
return self.native.Text

def assert_no_icon(self):
pytest.skip("Winforms doesn't support icons on buttons")

def assert_icon_size(self):
pytest.skip("Winforms doesn't support icons on buttons")

@property
def background_color(self):
if self.native.BackColor == SystemColors.Control:
Expand Down

0 comments on commit 58c0dc8

Please sign in to comment.