Skip to content

Commit f15ecab

Browse files
committed
test(target): use fxpoppet in tests
1 parent d2ceca3 commit f15ecab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/grizzly/target/test_adb_target.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This Source Code Form is subject to the terms of the Mozilla Public
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
from fxpoppet import ADBSession, Reason
45
from pytest import mark, raises
56

6-
from .adb_device import ADBSession, Reason
77
from .adb_target import ADBTarget
88
from .target import Result
99

@@ -33,7 +33,7 @@ def test_adb_target_01(mocker, tmp_path, kwargs):
3333
fake_session.get_package_name.return_value = "the_name"
3434
fake_apk = tmp_path / "test.apk"
3535
fake_apk.touch()
36-
with ADBTarget(str(fake_apk), 300, 25, 5000, **kwargs) as target:
36+
with ADBTarget(fake_apk, 300, 25, 5000, **kwargs) as target:
3737
assert target.closed
3838
assert target.forced_close
3939
assert target.monitor is not None
@@ -60,7 +60,7 @@ def test_adb_target_02(mocker, tmp_path):
6060
fake_apk = tmp_path / "test.apk"
6161
fake_apk.touch()
6262
with raises(RuntimeError, match="Could not create ADB Session!"):
63-
ADBTarget(str(fake_apk), 300, 25, 5000)
63+
ADBTarget(fake_apk, 300, 25, 5000)
6464

6565

6666
@mark.parametrize(
@@ -82,7 +82,7 @@ def test_adb_target_03(mocker, tmp_path, healthy, reason, result, closes):
8282
mocker.patch("grizzly.target.adb_target.ADBSession", autospec=True)
8383
fake_apk = tmp_path / "test.apk"
8484
fake_apk.touch()
85-
with ADBTarget(str(fake_apk), 300, 25, 5000) as target:
85+
with ADBTarget(fake_apk, 300, 25, 5000) as target:
8686
target.launch("fake.url")
8787
assert fake_process.return_value.launch.call_count == 1
8888
assert target.monitor.is_running()
@@ -99,7 +99,7 @@ def test_adb_target_04(mocker, tmp_path):
9999
mocker.patch("grizzly.target.adb_target.ADBSession", autospec=True)
100100
fake_apk = tmp_path / "test.apk"
101101
fake_apk.touch()
102-
with ADBTarget(str(fake_apk), 300, 25, 5000) as target:
102+
with ADBTarget(fake_apk, 300, 25, 5000) as target:
103103
fake_process.return_value.is_healthy.return_value = True
104104
fake_process.return_value.is_running.return_value = True
105105
assert not target.handle_hang()

0 commit comments

Comments
 (0)