def test_add_with_position(self): urls = self.urls result = url.add(urls, 'foo-list', 'http://www.zombo.com', position=5) self.assertEqual(len(result), 7) self.assertEqual(result[4].get('url'), 'http://www.zombo.com')
def test_add_with_position_without_section(self): urls = self.urls_with_sec result = url.add(urls, 'foo-list', 'http://www.zombo.com', position=3) self.assertEqual(len(result), 7) self.assertEqual(result[2].get('url'), 'http://www.zombo.com') self.assertEqual(result[3].get('hash'), 'FOO')
def test_add_without_position(self): urls = self.urls result = url.add(urls, 'foo-list', 'http://www.zombo.com') self.assertEqual(len(result), 7) self.assertEqual(result[0].get('url'), 'http://www.zombo.com') self.assertEqual(result[1].get('hash'), 'Foo')
def test_add_without_position_with_section(self): urls = self.urls_with_sec result = url.add(urls, 'foo-list', 'http://www.zombo.com', section=2) self.assertEqual(len(result), 7) self.assertEqual(result[4].get('url'), 'http://www.zombo.com') self.assertEqual(result[5].get('hash'), 'BAr')