Exemplo n.º 1
0
    def test_urls(self):
        meta = Metadata()
        meta.urls = ['http://google.com']
        assert len(meta.urls) == 1, meta.urls
        assert len(meta.domains) == 1, meta.domain
        assert meta.domains[0] == 'google.com', meta.domains

        meta.add_url('http://')
        assert len(meta.urls) == 1, meta.urls

        meta.add_url('http://www.google.com/xxx')
        assert len(meta.urls) == 2, meta.urls
        assert len(meta.domains) == 1, meta.domain
Exemplo n.º 2
0
    def test_urls(self):
        meta = Metadata()
        meta.urls = ['http://google.com']
        assert len(meta.urls) == 1, meta.urls
        assert len(meta.domains) == 1, meta.domain
        assert meta.domains[0] == 'google.com', meta.domains

        meta.add_url('http://')
        assert len(meta.urls) == 1, meta.urls

        meta.add_url('http://www.google.com/xxx')
        assert len(meta.urls) == 2, meta.urls
        assert len(meta.domains) == 1, meta.domain