Ejemplo n.º 1
0
    def test_storeclient_handle_url_trailing_slashes(self):

        test_client = StoreClient('http://store.example.com')
        self.assertEqual(test_client._url, 'http://store.example.com/')

        test_client = StoreClient('http://store.example.com///')
        self.assertEqual(test_client._url, 'http://store.example.com/')
Ejemplo n.º 2
0
    def _process_store_info(self, element):
        result = {
            'name': element.get('name'),
            'url': element.xpath(URL_XPATH)[0].text,
            'registrationDate': element.xpath(DATE_XPATH)[0].text
        }

        if result['name'] not in self._stores:
            self._stores[result['name']] = StoreClient(result['url'])

        return result
Ejemplo n.º 3
0
    def test_storeclient_must_ignore_params_query_and_framgent(self):

        test_client = StoreClient('http://store.example.com/?query=a#a')
        self.assertEqual(test_client._url, 'http://store.example.com/')
Ejemplo n.º 4
0
    def setUp(self):

        super(StoreTestCase, self).setUp()

        self.store_client = StoreClient('http://example.com')
        self.network._servers['http']['example.com'].clear()