Skip to content

Commit

Permalink
Allow for some branches we can't test.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Jun 14, 2024
1 parent 52ac11f commit d5e860c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 3 additions & 2 deletions android/src/toga_android/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ def onOptionsItemSelected(self, menuitem):

def onPrepareOptionsMenu(self, menu):
# If the main window doesn't have a toolbar, there's no preparation required;
# this is a simple main window, which can't have commands.
# this is a simple main window, which can't have commands. This can't be
# validated in the testbed, so it's marked no-cover.
if not hasattr(self._impl.interface.main_window, "toolbar"):
return False
return False # pragma: no cover

menu.clear()
itemid = 1 # 0 is the same as Menu.NONE.
Expand Down
5 changes: 3 additions & 2 deletions android/src/toga_android/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ def close(self): # pragma: no cover
# closed, so the platform-specific close handling is never triggered.
pass

def configure_titlebar(self):
# Hide the titlebar on a simple window.
def configure_titlebar(self): # pragma: no cover
# Hide the titlebar on a simple window. The testbed can't create a simple
# window, so we can't test this.
self.app.native.getSupportActionBar().hide()

def set_app(self, app):
Expand Down
9 changes: 3 additions & 6 deletions iOS/src/toga_iOS/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,13 @@ def __init__(
def height(self):
return self.layout_native.bounds.size.height - self.top_offset

# The testbed app won't instantiate a simple app, so we can't test these properties
@property
def top_offset(self):
def top_offset(self): # pragma: no cover
return UIApplication.sharedApplication.statusBarFrame.size.height

@property
def title(self):
def title(self): # pragma: no cover
return self._title

@title.setter
Expand Down Expand Up @@ -201,10 +202,6 @@ def __init__(
# Set the controller's view to be the root content widget
self.content_controller.view = self.native

@property
def height(self):
return self.layout_native.bounds.size.height - self.top_offset

@property
def top_offset(self):
return (
Expand Down

0 comments on commit d5e860c

Please sign in to comment.