test_geckoinstance.py (1038B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 from marionette_driver.geckoinstance import apps, GeckoInstance 6 7 from marionette_harness import MarionetteTestCase 8 9 10 class TestGeckoInstance(MarionetteTestCase): 11 def test_create(self): 12 """Test that the correct gecko instance is determined.""" 13 for app in apps: 14 # If app has been specified we directly return the appropriate instance class 15 self.assertEqual(type(GeckoInstance.create(app=app, bin="n/a")), apps[app]) 16 17 # Unknown applications and binaries should fail 18 self.assertRaises( 19 NotImplementedError, 20 GeckoInstance.create, 21 app="n/a", 22 bin=self.marionette.bin, 23 ) 24 self.assertRaises(NotImplementedError, GeckoInstance.create, bin="n/a") 25 self.assertRaises(NotImplementedError, GeckoInstance.create, bin=None)