def test_different_access(self):
     self.locators.menu.foo.bar = Locator.ID('bar')
     self.assertEqual(self.locators.menu['foo']['bar'], Locator.ID('bar'))
     self.assertEqual(self.locators.menu['foo'].bar, Locator.ID('bar'))
     self.assertEqual(self.locators.menu.foo.bar, Locator.ID('bar'))
     self.assertEqual(self.locators['menu'].foo.bar, Locator.ID('bar'))
     self.assertEqual(self.locators['menu']['foo'].bar, Locator.ID('bar'))
     self.assertEqual(self.locators['menu']['foo']['bar'],
                      Locator.ID('bar'))
     self.assertEqual(self.locators['menu.foo.bar'], Locator.ID('bar'))
 def test_inspect_members(self):
     root = LocatorDict()
     root.menu.home = Locator.XPATH('//div')
     root.menu.contact = Locator.ID('contact')
     root.menu.login = Locator.CLASS('login')
     self.assertEqual(
         sorted(dir(root.menu)),
         sorted(
             ['home', 'contact', 'login', '_store', '_value', '_strategy']))
 def test_root_node_is_empty(self):
     self.locators.menu.foo.bar.zaz.blarg = Locator.ID('buzz')
     self.assertEqual(self.locators.menu.foo.bar.zaz.blarg._value, 'buzz')
     self.assertIsNone(self.locators.menu.foo._value)
     self.assertIsNone(self.locators.menu.foo._strategy)
 def test_id_locator(self):
     self.assertEqual(Locator.ID('zaz')._strategy, By.ID)