예제 #1
0
    def test_resolve_alias_or_index_with_none(self):
        cache = WebDriverCache()

        cache.register(mock(), "foo")
        cache.register(mock(), "None")

        index = cache.get_index("foo")
        self.assertEqual(index, 1)

        index = cache.get_index(1)
        self.assertEqual(index, 1)

        index = cache.get_index(None)
        self.assertEqual(index, None)
예제 #2
0
    def test_resolve_alias_or_index_error(self):
        cache = WebDriverCache()

        cache.register(mock(), "foo")
        cache.register(mock())

        index = cache.get_index("bar")
        self.assertEqual(index, None)

        index = cache.get_index(12)
        self.assertEqual(index, None)

        index = cache.get_index(-1)
        self.assertEqual(index, None)
    def test_resolve_alias_or_index_error(self):
        cache = WebDriverCache()

        cache.register(mock(), 'foo')
        cache.register(mock())

        index = cache.get_index('bar')
        self.assertEqual(index, None)

        index = cache.get_index(12)
        self.assertEqual(index, None)

        index = cache.get_index(-1)
        self.assertEqual(index, None)
예제 #4
0
    def test_close_and_same_alias(self):
        cache = WebDriverCache()

        cache.register(mock(), "foo")
        cache.register(mock(), "bar")
        cache.close()
        index = cache.get_index("bar")
        self.assertEqual(index, None)
    def test_close_and_same_alias(self):
        cache = WebDriverCache()

        cache.register(mock(), 'foo')
        cache.register(mock(), 'bar')
        cache.close()
        index = cache.get_index('bar')
        self.assertEqual(index, None)
    def test_resolve_alias_or_index_with_none(self):
        cache = WebDriverCache()

        cache.register(mock(), 'foo')
        cache.register(mock(), 'None')

        index = cache.get_index('foo')
        self.assertEqual(index, 1)

        index = cache.get_index(1)
        self.assertEqual(index, 1)

        index = cache.get_index(None)
        self.assertEqual(index, None)

        index = cache.get_index('None')
        self.assertEqual(index, None)

        index = cache.get_index('NoNe')
        self.assertEqual(index, None)
    def test_resolve_alias_or_index_with_none(self):
        cache = WebDriverCache()

        cache.register(mock(), 'foo')
        cache.register(mock(), 'None')

        index = cache.get_index('foo')
        self.assertEqual(index, 1)

        index = cache.get_index(1)
        self.assertEqual(index, 1)

        index = cache.get_index(None)
        self.assertEqual(index, None)

        index = cache.get_index('None')
        self.assertEqual(index, None)

        index = cache.get_index('NoNe')
        self.assertEqual(index, None)
예제 #8
0
 def test_same_alias_new_browser(self):
     cache = WebDriverCache()
     cache.close()
     index = cache.get_index("bar")
     self.assertEqual(index, None)
 def test_same_alias_new_browser(self):
     cache = WebDriverCache()
     cache.close()
     index = cache.get_index('bar')
     self.assertEqual(index, None)