Beispiel #1
0
    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')
Beispiel #2
0
    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')
Beispiel #3
0
    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')
Beispiel #4
0
    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')
Beispiel #5
0
    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')
Beispiel #6
0
    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')