From afea49a2c81f62a5cdf7e690b2620665bd189c24 Mon Sep 17 00:00:00 2001 From: tadashi0713 Date: Sat, 5 Jan 2019 15:56:24 +0900 Subject: [PATCH] Add unittest to run appium with relaxed security --- src/tests/unit/test_app.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/tests/unit/test_app.py b/src/tests/unit/test_app.py index 9b48fa5..f8e2c2f 100644 --- a/src/tests/unit/test_app.py +++ b/src/tests/unit/test_app.py @@ -64,6 +64,19 @@ class TestApp(TestCase): self.assertTrue(mocked_subprocess.called) self.assertTrue(mocked_appium.called) + @mock.patch('src.app.prepare_avd') + @mock.patch('builtins.open') + @mock.patch('subprocess.Popen') + def test_run_with_appium_and_relaxed_security(self, mocked_avd, mocked_open, mocked_subprocess): + with mock.patch('src.app.appium_run') as mocked_appium: + os.environ['APPIUM'] = str(True) + os.environ['RELAXED_SECURITY'] = str(True) + app.run() + self.assertTrue(mocked_avd.called) + self.assertTrue(mocked_open.called) + self.assertTrue(mocked_subprocess.called) + self.assertTrue(mocked_appium.called) + @mock.patch('src.app.prepare_avd') @mock.patch('builtins.open') @mock.patch('subprocess.Popen')