Skip to content

Commit

Permalink
Replace get_default_test_tmpdir() with create_tempdir().
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 651758575
  • Loading branch information
kenjitoyama authored and copybara-github committed Jul 12, 2024
1 parent 89b0c79 commit a2b9284
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion android_env/components/coordinator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def test_with_tmp_dir_no_tempfile_call(self, mock_gettempdir,
simulator=self._simulator,
task_manager=self._task_manager,
config=config_classes.CoordinatorConfig(
tmp_dir=absltest.get_default_test_tmpdir()
tmp_dir=self.create_tempdir().full_path
),
)
mock_gettempdir.assert_not_called()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def setUp(self):
def test_adb_device_name_not_empty(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -93,7 +93,7 @@ def test_logfile_path(self, mock_open, unused_mock_exists):
config = config_classes.EmulatorConfig(
logfile_path='fake/logfile/path',
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -111,7 +111,7 @@ def test_logfile_path(self, mock_open, unused_mock_exists):
def test_grpc_port(self, unused_mock_portpicker):

launcher_config = config_classes.EmulatorLauncherConfig(
tmp_dir=absltest.get_default_test_tmpdir()
tmp_dir=self.create_tempdir().full_path
)
config = config_classes.EmulatorConfig(
emulator_launcher=launcher_config,
Expand All @@ -127,7 +127,7 @@ def test_grpc_port(self, unused_mock_portpicker):
def test_grpc_port_unavailable(self, unused_mock_portpicker):

launcher_config = config_classes.EmulatorLauncherConfig(
tmp_dir=absltest.get_default_test_tmpdir()
tmp_dir=self.create_tempdir().full_path
)
config = config_classes.EmulatorConfig(
emulator_launcher=launcher_config,
Expand All @@ -152,7 +152,7 @@ def test_launch_operation_order(self):
)
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -171,7 +171,7 @@ def test_launch_operation_order(self):
def test_close(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -194,7 +194,7 @@ def test_value_error_if_launch_attempt_params_incorrect(self):
emulator_simulator.EmulatorSimulator,
config=config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -208,7 +208,7 @@ def test_value_error_if_launch_attempt_params_incorrect(self):
def test_launch_attempt_reboot(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -234,7 +234,7 @@ def test_launch_attempt_reboot(self):
def test_launch_attempt_reinstall_after_zero_attempts(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -261,7 +261,7 @@ def test_launch_attempt_reinstall_after_zero_attempts(self):
def test_launch_attempt_reinstall(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand Down Expand Up @@ -293,7 +293,7 @@ def test_launch_attempt_reinstall(self):
def test_get_screenshot(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand All @@ -319,7 +319,7 @@ def test_get_screenshot(self):
def test_load_state(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand Down Expand Up @@ -373,7 +373,7 @@ def test_load_state(self):
def test_save_state(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand Down Expand Up @@ -415,7 +415,7 @@ def test_save_state(self):
def test_send_touch(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand Down Expand Up @@ -472,7 +472,7 @@ def test_send_touch(self):
def test_send_key(self):
config = config_classes.EmulatorConfig(
emulator_launcher=config_classes.EmulatorLauncherConfig(
grpc_port=1234, tmp_dir=absltest.get_default_test_tmpdir()
grpc_port=1234, tmp_dir=self.create_tempdir().full_path
),
adb_controller=config_classes.AdbControllerConfig(
adb_path='/my/adb',
Expand Down

0 comments on commit a2b9284

Please sign in to comment.