Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2011 from freakboy3742/audit-table
[widget audit] toga.Table
- Loading branch information
Showing
93 changed files
with
3,047 additions
and
1,440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
|
||
from android.graphics import Bitmap | ||
|
||
from .probe import BaseProbe | ||
|
||
|
||
class IconProbe(BaseProbe): | ||
# Android only supports 1 format, so the alternate is the same as the primary. | ||
alternate_resource = "resources/icons/blue" | ||
|
||
def __init__(self, app, icon): | ||
super().__init__() | ||
self.app = app | ||
self.icon = icon | ||
assert isinstance(self.icon._impl.native, Bitmap) | ||
|
||
def assert_icon_content(self, path): | ||
if path == "resources/icons/green": | ||
assert ( | ||
self.icon._impl.path | ||
== self.app.paths.app / "resources" / "icons" / "green.png" | ||
) | ||
elif path == "resources/icons/blue": | ||
assert ( | ||
self.icon._impl.path | ||
== self.app.paths.app / "resources" / "icons" / "blue.png" | ||
) | ||
else: | ||
pytest.fail("Unknown icon resource") | ||
|
||
def assert_default_icon_content(self): | ||
assert self.icon._impl.path == self.app.paths.toga / "resources" / "toga.png" |
Oops, something went wrong.