Ejemplo n.º 1
0
class TestTigreBuild(TestCase):
    def setUp(self):
        self.tigre = Tigre()

    @mock.patch('selenium.webdriver.Remote')
    def test_should_call_selenium_with_default_url(self, mock):
        self.tigre.build()

        mock.assert_called_with(
            command_executor='http://*****:*****@mock.patch('selenium.webdriver.Remote')
    def test_should_call_selenium_with_configurantion_modified(self, mock):
        with config_wrapper('remote_url', 'test_url'):
            self.tigre.build()

        mock.assert_called_with(
            command_executor='test_url', desired_capabilities={}
        )
Ejemplo n.º 2
0
 def setUp(self):
     self.tigre = Tigre()
Ejemplo n.º 3
0
    def test_should_return_value_if_was_fixed(self):
        tigre = Tigre()
        tigre._fixed_caps = {'batatinha': 123}

        self.assertEqual(tigre.batatinha, 123)
Ejemplo n.º 4
0
    def test_closure_shouldnt_convert_booleans_caps(self):
        tigre = Tigre(default_caps=['enableVNC'])
        tigre.vnc(True)

        self.assertIn(True, tigre.capabilities.values())
Ejemplo n.º 5
0
    def test_should_raises_with_wrog_caps(self):
        tigre = Tigre(default_caps=[])

        with self.assertRaises(AttributeError):
            tigre.test('test')
Ejemplo n.º 6
0
    def test_closure_should_convert_non_booleans_caps(self):
        tigre = Tigre(default_caps=['version'])
        tigre.version(7)

        self.assertEqual(tigre.capabilities['version'], '7')
Ejemplo n.º 7
0
    def test_closure_should_insert_new_caps(self):
        tigre = Tigre()
        tigre.version(None)

        self.assertIn('version', tigre.capabilities)
Ejemplo n.º 8
0
    def test_closure_should_return_self(self):
        tigre = Tigre()

        self.assertIs(tigre.version(None), tigre)
Ejemplo n.º 9
0
    def test_new_attr_should_return_callable(self):
        tigre = Tigre()
        tigre.version

        self.assertTrue(hasattr(tigre.version, '__call__'))
Ejemplo n.º 10
0
    def test_should_set_new_attrs(self):
        tigre = Tigre()
        tigre.version

        self.assertTrue(tigre.version)