Ejemplo n.º 1
0
    def setUp(self):
        """Setup tests."""
        from inspire.modules.workflows.receivers import precache_holdingpen_row
        from invenio_workflows.receivers import index_holdingpen_record
        from invenio_workflows.signals import workflow_halted, workflow_object_saved

        # Disable the holdingpen caching receiver.
        workflow_halted.disconnect(precache_holdingpen_row)
        workflow_object_saved.disconnect(index_holdingpen_record)

        self.create_registries()
        self.record_oai_arxiv_plots = pkg_resources.resource_string(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "oai_arxiv_record_with_plots.xml")
        )
        self.record_oai_arxiv_accept = pkg_resources.resource_string(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "oai_arxiv_record_to_accept.xml")
        )
        self.some_record = pkg_resources.resource_string(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "some_record.xml")
        )
        self.arxiv_tarball = pkg_resources.resource_stream(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "1407.7587v1")
        )
        self.arxiv_pdf = pkg_resources.resource_stream(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "1407.7587v1.pdf")
        )
        self.arxiv_tarball_accept = pkg_resources.resource_stream(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "1511.01097")
        )
        self.arxiv_pdf_accept = pkg_resources.resource_stream(
            "inspire.testsuite", os.path.join("workflows", "fixtures", "1511.01097v1.pdf")
        )
Ejemplo n.º 2
0
    def setUp(self):
        """Setup tests."""
        from invenio_knowledge.api import add_kb
        from inspire.modules.workflows.receivers import precache_holdingpen_row
        from invenio_workflows.receivers import index_holdingpen_record
        from invenio_workflows.signals import (
            workflow_halted,
            workflow_object_saved
        )

        # Disable the holdingpen caching receiver.
        workflow_halted.disconnect(precache_holdingpen_row)
        workflow_object_saved.disconnect(index_holdingpen_record)

        self.create_registries()
        self.record_oai_arxiv_plots = pkg_resources.resource_string(
            'inspire.testsuite',
            os.path.join(
                'workflows',
                'fixtures',
                'oai_arxiv_record_with_plots.xml'
            )
        )
        self.some_record = pkg_resources.resource_string(
            'inspire.testsuite',
            os.path.join(
                'workflows',
                'fixtures',
                'some_record.xml'
            )
        )
        self.arxiv_tarball = pkg_resources.resource_stream(
            'inspire.testsuite',
            os.path.join(
                'workflows',
                'fixtures',
                '1407.7587v1'
            )
        )
        self.arxiv_pdf = pkg_resources.resource_stream(
            'inspire.testsuite',
            os.path.join(
                'workflows',
                'fixtures',
                '1407.7587v1.pdf'
            )
        )
        # Add temp KB
        add_kb('harvesting_fixture_kb')
Ejemplo n.º 3
0
    def setUp(self):
        """Setup tests."""
        from inspirehep.modules.workflows.receivers import precache_holdingpen_row
        from invenio_workflows.receivers import index_holdingpen_record
        from invenio_workflows.signals import (
            workflow_halted,
            workflow_object_saved
        )

        # Disable the holdingpen caching receiver.
        workflow_halted.disconnect(precache_holdingpen_row)
        workflow_object_saved.disconnect(index_holdingpen_record)

        self.create_registries()
        self.record_oai_arxiv_plots = pkg_resources.resource_string(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                'oai_arxiv_record_with_plots.xml'
            )
        )
        self.record_oai_arxiv_accept = pkg_resources.resource_string(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                'oai_arxiv_record_to_accept.xml'
            )
        )
        self.some_record = pkg_resources.resource_string(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                'some_record.xml'
            )
        )
        self.arxiv_tarball = pkg_resources.resource_stream(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                '1407.7587v1'
            )
        )
        self.arxiv_pdf = pkg_resources.resource_stream(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                '1407.7587v1.pdf'
            )
        )
        self.arxiv_tarball_accept = pkg_resources.resource_stream(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                '1511.01097'
            )
        )
        self.arxiv_pdf_accept = pkg_resources.resource_stream(
            'tests',
            os.path.join(
                'workflows',
                'fixtures',
                '1511.01097v1.pdf'
            )
        )