Beispiel #1
0
    def test07_try_robots(self):
        uri = "http://localhost:8000/rs/source/discover/loc2"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Reliproc)
        processor.read_source()
Beispiel #2
0
    def test02_capabilitylist(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/capabilitylist.xml"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Capaproc)
        self.assertEqual(processor.status, Status.document)
Beispiel #3
0
    def __do_task__(self, task):
        for uri in self.sources:
            processor = None
            if task == "discover":
                discoverer = Discoverer(uri)
                processor = discoverer.get_processor()
            elif task == "wellknown":
                processor = Sodesproc(uri)
            elif task == "capability":
                processor = Capaproc(uri)

            if processor is None:
                msg = "Could not discover processor for '%s'" % uri
                self.logger.warn(msg)
                self.exceptions.append(msg)
                des.reporter.instance().log_status(uri, exception=msg)
            else:
                try:
                    processor.process_source()
                    self.exceptions.extend(processor.exceptions)
                    # do something with processor status
                except Exception as err:
                    self.exceptions.append(err)
                    self.logger.warn("Failure while syncing %s" % uri, exc_info=True)
                    des.reporter.instance().log_status(uri, exception=err)
Beispiel #4
0
    def test01_well_known(self):
        uri = "http://localhost:8000/rs/source/discover/loc1"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Sodesproc)
        self.assertEqual(processor.status, Status.document)
Beispiel #5
0
    def test07_try_robots(self):
        uri = "http://localhost:8000/rs/source/discover/loc2"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Reliproc)
        processor.read_source()
Beispiel #6
0
    def test02_capabilitylist(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/capabilitylist.xml"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Capaproc)
        self.assertEqual(processor.status, Status.document)
Beispiel #7
0
    def test01_well_known(self):
        uri = "http://localhost:8000/rs/source/discover/loc1"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Sodesproc)
        self.assertEqual(processor.status, Status.document)
Beispiel #8
0
    def test08_try_robots_with_netloc(self):
        DestinationMap().__remove_destination__("http://localhost:8000/rs/source/discover/")
        Config().__set_prop__(Config.key_use_netloc, "True")
        uri = "http://localhost:8000/rs/source/discover/loc2"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Reliproc)
        processor.read_source()
Beispiel #9
0
    def test08_try_robots_with_netloc(self):
        DestinationMap().__remove_destination__(
            "http://localhost:8000/rs/source/discover/")
        Config().__set_prop__(Config.key_use_netloc, "True")
        uri = "http://localhost:8000/rs/source/discover/loc2"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Reliproc)
        processor.read_source()
Beispiel #10
0
    def test06_try_link_unparsable_html(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/unparsable.html"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsNone(processor)
Beispiel #11
0
    def test05_try_link_absent_html(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/no_page.html"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsNone(processor)
Beispiel #12
0
    def test03_try_link_html(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/page.html"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Capaproc)
Beispiel #13
0
    def test06_try_link_unparsable_html(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/unparsable.html"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsNone(processor)
Beispiel #14
0
    def test05_try_link_absent_html(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/no_page.html"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsNone(processor)
Beispiel #15
0
    def test03_try_link_html(self):
        uri = "http://localhost:8000/rs/source/discover/loc1/page.html"
        discoverer = Discoverer(uri)

        processor = discoverer.get_processor()
        self.assertIsInstance(processor, proc.Capaproc)