예제 #1
0
 def setUp(self):
     """We have a submission."""
     self.creator = User(native_id=1234, email='*****@*****.**')
     self.submission = Submission(
         submission_id=2347441,
         creator=self.creator,
         owner=self.creator,
         created=datetime.now(UTC),
         source_content=SubmissionContent(
             identifier='5678',
             source_format=SubmissionContent.Format('pdf'),
             checksum='a1b2c3d4',
             uncompressed_size=58493,
             compressed_size=58493
         )
     )
     self.submission.submitter_contact_verified = True
     self.submission.submitter_accepts_policy = True
     self.submission.license = License(name='foo', uri='http://foo.foo')
     self.submission.metadata = SubmissionMetadata(
         title='foo',
         abstract='oof',
         authors_display='Bloggs, J'
     )
     self.process = \
         ProposeCrossListFromPrimaryCategory(self.submission.submission_id)
예제 #2
0
 def setUp(self):
     """We have a submission."""
     self.creator = User(native_id=1234, email='*****@*****.**')
     self.submission = Submission(submission_id=2347441,
                                  creator=self.creator,
                                  owner=self.creator,
                                  created=datetime.now(UTC))
     self.process = CheckSubmissionSourceSize(self.submission.submission_id)
 def setUp(self):
     """We have a submission."""
     self.app = create_app()
     self.creator = User(native_id=1234,
                         email='*****@*****.**',
                         forename='Ross',
                         surname='Perot')
     self.submission_id = 12345
     self.before = Submission(
         submission_id=self.submission_id,
         metadata=mock.MagicMock(
             title="The best title",
             authors_display="Frank Underwood (POTUS)",
             abstract=
             "Pork loin meatloaf meatball in cow et. Tail pork ut velit, eu prosciutto pork chop pariatur ad non hamburger bacon cupidatat. Short loin nulla aute esse spare ribs eiusmod consequat anim capicola chuck cupim labore alcatra strip steak tail. Lorem short ribs andouille leberkas pork belly. Andouille fatback ham hock burgdoggen, ham pork belly labore doner aute esse.",
             comments=
             "Aliqua ham capicola minim filet mignon tenderloin voluptate bacon biltong shank in chuck do pig in. Id pariatur jowl ad ham pork chop doner buffalo laboris sed ut",
             msc_class="14J60 (Primary), 14F05, 14J26 (Secondary)",
             acm_class="F.2.2; I.2.7",
             journal_ref="Nature 2021 39202:32-12",
             report_num="Report 1234",
             doi="10.00123/43463"),
         source_content=mock.MagicMock(uncompressed_size=392019),
         version=1,
         primary_classification=mock.MagicMock(category='cs.DL'),
         license=mock.MagicMock(uri='http://some.license/v2'),
         creator=self.creator,
         owner=self.creator,
         created=datetime(2018, 3, 4, 18, 34, 2, tzinfo=UTC),
         submitted=datetime(2018, 3, 4, 19, 34, 2, tzinfo=UTC),
         status=Submission.WORKING)
     self.after = Submission(
         submission_id=12345,
         metadata=mock.MagicMock(
             title="The best title",
             authors_display="Frank Underwood (POTUS)",
             abstract=
             "Pork loin meatloaf meatball in cow et. Tail pork ut velit, eu prosciutto pork chop pariatur ad non hamburger bacon cupidatat. Short loin nulla aute esse spare ribs eiusmod consequat anim capicola chuck cupim labore alcatra strip steak tail. Lorem short ribs andouille leberkas pork belly. Andouille fatback ham hock burgdoggen, ham pork belly labore doner aute esse.",
             comments=
             "Aliqua ham capicola minim filet mignon tenderloin voluptate bacon biltong shank in chuck do pig in. Id pariatur jowl ad ham pork chop doner buffalo laboris sed ut",
             msc_class="14J60 (Primary), 14F05, 14J26 (Secondary)",
             acm_class="F.2.2; I.2.7",
             journal_ref="Nature 2021 39202:32-12",
             report_num="Report 1234",
             doi="10.00123/43463"),
         source_content=mock.MagicMock(uncompressed_size=392019),
         version=1,
         primary_classification=mock.MagicMock(category='cs.DL'),
         license=mock.MagicMock(uri='http://some.license/v2'),
         creator=self.creator,
         owner=self.creator,
         created=datetime(2018, 3, 4, 18, 34, 2, tzinfo=UTC),
         submitted=datetime(2018, 3, 4, 19, 34, 2, tzinfo=UTC),
         status=Submission.SUBMITTED)
     self.event = FinalizeSubmission(creator=self.creator,
                                     created=datetime.now(UTC))
     self.process = SendConfirmationEmail(self.submission_id)
예제 #4
0
 def setUp(self):
     """We have a submission."""
     self.creator = User(native_id=1234, email='*****@*****.**')
     self.submission = Submission(
         submission_id=2347441,
         creator=self.creator,
         owner=self.creator,
         created=datetime.now(UTC),
         source_content=SubmissionContent(
             identifier='5678',
             source_format=SubmissionContent.Format('pdf'),
             checksum='a1b2c3d4',
             uncompressed_size=58493,
             compressed_size=58493))
     self.process = CheckPDFSize(self.submission.submission_id)
예제 #5
0
    def setUp(self):
        """Create an application instance."""
        self.app = create_ui_web_app()
        os.environ['JWT_SECRET'] = self.app.config.get('JWT_SECRET')
        _, self.db = tempfile.mkstemp(suffix='.db')
        self.app.config['CLASSIC_DATABASE_URI'] = f'sqlite:///{self.db}'
        self.user = User('1234',
                         '*****@*****.**',
                         endorsements=['astro-ph.GA', 'astro-ph.CO'])
        self.token = generate_token(
            '1234',
            '*****@*****.**',
            'foouser',
            scope=[
                scopes.CREATE_SUBMISSION, scopes.EDIT_SUBMISSION,
                scopes.VIEW_SUBMISSION, scopes.READ_UPLOAD,
                scopes.WRITE_UPLOAD, scopes.DELETE_UPLOAD_FILE
            ],
            endorsements=[
                Category('astro-ph.GA'),
                Category('astro-ph.CO'),
            ])
        self.headers = {'Authorization': self.token}
        self.client = self.app.test_client()

        # Create and announce a submission.
        with self.app.app_context():
            classic.create_all()
            session = classic.current_session()

            cc0 = 'http://creativecommons.org/publicdomain/zero/1.0/'
            self.submission, _ = save(
                CreateSubmission(creator=self.user),
                ConfirmContactInformation(creator=self.user),
                ConfirmAuthorship(creator=self.user, submitter_is_author=True),
                SetLicense(creator=self.user,
                           license_uri=cc0,
                           license_name='CC0 1.0'),
                ConfirmPolicy(creator=self.user),
                SetPrimaryClassification(creator=self.user,
                                         category='astro-ph.GA'),
                SetUploadPackage(
                    creator=self.user,
                    checksum="a9s9k342900skks03330029k",
                    source_format=SubmissionContent.Format.TEX,
                    identifier=123,
                    uncompressed_size=593992,
                    compressed_size=59392,
                ), SetTitle(creator=self.user, title='foo title'),
                SetAbstract(creator=self.user, abstract='ab stract' * 20),
                SetComments(creator=self.user, comments='indeed'),
                SetReportNumber(creator=self.user, report_num='the number 12'),
                SetAuthors(creator=self.user,
                           authors=[
                               Author(order=0,
                                      forename='Bob',
                                      surname='Paulson',
                                      email='*****@*****.**',
                                      affiliation='Fight Club')
                           ]), FinalizeSubmission(creator=self.user))

            # announced!
            db_submission = session.query(classic.models.Submission) \
                .get(self.submission.submission_id)
            db_submission.status = classic.models.Submission.ANNOUNCED
            db_document = classic.models.Document(paper_id='1234.5678')
            db_submission.doc_paper_id = '1234.5678'
            db_submission.document = db_document
            session.add(db_submission)
            session.add(db_document)
            session.commit()

        self.submission_id = self.submission.submission_id
예제 #6
0
from arxiv.submission.domain.agent import User

TITLES = [
    (2344371,
     'Maximally Rotating Supermassive Stars at the Onset of Collapse: The Perturbative Effects of Gas Pressure, Magnetic Fields, Dark Matter and Dark Energy',
     User(native_id=12345,
          email='*****@*****.**',
          forename='',
          surname='',
          suffix='',
          identifier=None,
          affiliation='',
          endorsements=[])),
    (2344372, 'Deep learning approach for Fourier ptychography microscopy',
     User(native_id=12345,
          email='*****@*****.**',
          forename='',
          surname='',
          suffix='',
          identifier=None,
          affiliation='',
          endorsements=[])),
    (2344378,
     'Implementing nonlinear Compton scattering beyond the local constant field approximation',
     User(native_id=12345,
          email='*****@*****.**',
          forename='',
          surname='',
          suffix='',
          identifier=None,
          affiliation='',