From d4832ad2b8abc1f083b83faeceebb816da1f9177 Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Fri, 22 Jun 2018 01:37:54 +0200 Subject: [PATCH] Fixed unit test --- src/tests/unit/test_app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tests/unit/test_app.py b/src/tests/unit/test_app.py index d6e8c15..80da2b2 100644 --- a/src/tests/unit/test_app.py +++ b/src/tests/unit/test_app.py @@ -53,21 +53,25 @@ class TestApp(TestCase): self.assertEqual(app.convert_str_to_bool(True), None) @mock.patch('src.app.prepare_avd') + @mock.patch('builtins.open') @mock.patch('subprocess.Popen') - def test_run_with_appium(self, mocked_avd, mocked_subprocess): + def test_run_with_appium(self, mocked_avd, mocked_open, mocked_subprocess): with mock.patch('src.app.appium_run') as mocked_appium: os.environ['APPIUM'] = 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') - def test_run_withhout_appium(self, mocked_avd, mocked_subprocess): + def test_run_withhout_appium(self, mocked_avd, mocked_open, 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_open.called) self.assertTrue(mocked_subprocess.called) self.assertFalse(mocked_appium.called)