Run emulator in the beginning

This commit is contained in:
butomo1989
2017-04-06 16:29:11 +02:00
parent 0a605cf226
commit 7b7238f156
3 changed files with 14 additions and 5 deletions
+6 -2
View File
@@ -34,16 +34,20 @@ class TestApp(TestCase):
self.assertEqual(app.str_to_bool(True), None)
@mock.patch('src.app.prepare_avd')
def test_run_with_appium(self, mocked_avd):
@mock.patch('subprocess.Popen')
def test_run_with_appium(self, mocked_avd, mocked_subprocess):
with mock.patch('src.app.appium_run') as mocked_appium:
app.run()
self.assertTrue(mocked_avd.called)
self.assertTrue(mocked_subprocess.called)
self.assertTrue(mocked_appium.called)
@mock.patch('src.app.prepare_avd')
def test_run_withhout_appium(self, mocked_avd):
@mock.patch('subprocess.Popen')
def test_run_withhout_appium(self, mocked_avd, mocked_subprocess):
with mock.patch('src.app.appium_run') as mocked_appium:
os.environ['APPIUM'] = str(False)
app.run()
self.assertTrue(mocked_avd.called)
self.assertTrue(mocked_subprocess.called)
self.assertFalse(mocked_appium.called)