Merge pull request #134 from tadashi0713/add_unittest_relaxed_security

Add unittest to run appium with relaxed security
This commit is contained in:
Budi Utomo 2019-01-07 09:20:58 +01:00 committed by GitHub
commit 98b0b3a140
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,19 @@ class TestApp(TestCase):
self.assertTrue(mocked_subprocess.called) self.assertTrue(mocked_subprocess.called)
self.assertTrue(mocked_appium.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('src.app.prepare_avd')
@mock.patch('builtins.open') @mock.patch('builtins.open')
@mock.patch('subprocess.Popen') @mock.patch('subprocess.Popen')