Skip to content

Commit

Permalink
PEP8, typo, MOCK->mock, unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian-O committed Aug 27, 2023
1 parent 1445c6a commit 835bbdb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions buildozer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import warnings

import buildozer.buildops as buildops
from buildozer.exceptions import BuildozerCommandException
from buildozer.jsonstore import JsonStore
from buildozer.logger import Logger
from buildozer.specparser import SpecParser
Expand Down Expand Up @@ -283,7 +282,7 @@ def _ensure_virtualenv(self):
env=self.environ)

# read virtualenv output and parse it
assert(sys.platform != "win32", "Can't call bash on Windows")
assert sys.platform != "win32", "Can't call bash on Windows"
output = buildops.cmd(
["bash", "-c", "source venv/bin/activate && env"],
get_stdout=True,
Expand Down
2 changes: 1 addition & 1 deletion buildozer/targets/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def _unlock_keychain(self):
error = buildops.cmd(
["security", "unlock-keychain", "-u"],
break_on_error=False,
quiet=True, # Log doesn't need secure info
quiet=True, # Log doesn't need secure info
env=self.buildozer.environ).return_code
if not error:
return
Expand Down
11 changes: 5 additions & 6 deletions tests/targets/test_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from buildozer.targets.android import TargetAndroid
from tests.targets.utils import (
init_buildozer,
patch_buildozer,
patch_buildops_checkbin,
patch_buildops_cmd,
patch_buildops_file_exists,
Expand All @@ -25,7 +24,7 @@ def patch_buildops_download():


def patch_buildops_file_extract():
return mock.path("buildozer.buildops.file_extract")
return mock.patch("buildozer.buildops.file_extract")


def patch_os_isfile():
Expand Down Expand Up @@ -154,7 +153,7 @@ def test_check_requirements(self):
assert not hasattr(target_android, "adb_executable")
assert not hasattr(target_android, "adb_args")
assert not hasattr(target_android, "javac_cmd")
assert "PATH" not in buildozer.environ
del buildozer.environ["PATH"]
with patch_buildops_checkbin() as m_checkbin:
target_android.check_requirements()
assert m_checkbin.call_args_list == [
Expand Down Expand Up @@ -255,7 +254,7 @@ def test_execute_build_package__debug__apk(self):
"arm64-v8a",
"--arch",
"armeabi-v7a"
])
], env=mock.ANY)
]

def test_execute_build_package__release__apk(self):
Expand All @@ -278,7 +277,7 @@ def test_execute_build_package__release__apk(self):
"arm64-v8a",
"--arch",
"armeabi-v7a"
])
], env=mock.ANY)
]

def test_execute_build_package__release__aab(self):
Expand All @@ -302,7 +301,7 @@ def test_execute_build_package__release__aab(self):
"arm64-v8a",
"--arch",
"armeabi-v7a",
])
], env=mock.ANY)
]

def test_numeric_version(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/targets/test_ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_build_package_no_signature(self):
"clean",
"build"],
cwd="/ios/dir/myapp-ios",
env=MOCK.ANY,
env=mock.ANY,
),
mock.call([
"xcodebuild",
Expand Down
4 changes: 0 additions & 4 deletions tests/targets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
from buildozer import Buildozer


def patch_buildozer(method):
return mock.patch("buildozer.Buildozer.{method}".format(method=method))


def patch_buildops_cmd():
return mock.patch("buildozer.buildops.cmd")

Expand Down

0 comments on commit 835bbdb

Please sign in to comment.