def test_get_status_transfer_to_ingest(self):
        # Reference values
        transfer_uuid = 'dfc8cf5f-b5b1-408c-88b1-34215964e9d6'
        unit_name = 'test1'
        sip_uuid = 'f2248e2a-b593-43db-b60c-fa8513021785'
        # Setup transfer in DB
        new_transfer = models.Unit(uuid=transfer_uuid,
                                   path=b'/foo',
                                   unit_type='transfer',
                                   status='PROCESSING',
                                   current=True)
        session.add(new_transfer)
        session.commit()

        # Run test
        info = transfer.get_status(AM_URL, USER, API_KEY, SS_URL, SS_USER,
                                   SS_KEY, transfer_uuid, 'transfer', session)
        # Verify
        assert isinstance(info, dict)
        assert info['status'] == 'USER_INPUT'
        assert info['type'] == 'SIP'
        assert info['name'] == unit_name
        assert info['uuid'] == sip_uuid
        assert info['directory'] == unit_name + '-' + sip_uuid
        assert info['path'] == ('/var/archivematica/sharedDirectory/'
                                'watchedDirectories/workFlowDecisions/'
                                'selectFormatIDToolIngest/'
                                'test1-f2248e2a-b593-43db-b60c-fa8513021785/')
Beispiel #2
0
 def test_get_status_transfer_to_ingest(self):
     # Reference values
     transfer_uuid = "dfc8cf5f-b5b1-408c-88b1-34215964e9d6"
     unit_name = "test1"
     sip_uuid = "f2248e2a-b593-43db-b60c-fa8513021785"
     # Setup transfer in DB
     models._update_unit(
         uuid=transfer_uuid,
         path=b"/foo",
         unit_type="transfer",
         status="PROCESSING",
         current=True,
     )
     # Run test
     info = transfer.get_status(
         AM_URL, USER, API_KEY, SS_URL, SS_USER, SS_KEY, transfer_uuid, "transfer"
     )
     # Verify
     assert isinstance(info, dict)
     assert info["status"] == "USER_INPUT"
     assert info["type"] == "SIP"
     assert info["name"] == unit_name
     assert info["uuid"] == sip_uuid
     assert info["directory"] == unit_name + "-" + sip_uuid
     assert info["path"] == (
         "/var/archivematica/sharedDirectory/"
         "watchedDirectories/workFlowDecisions/"
         "selectFormatIDToolIngest/"
         "test1-f2248e2a-b593-43db-b60c-fa8513021785/"
     )
Beispiel #3
0
 def test_get_status_ingest(self):
     sip_uuid = 'f2248e2a-b593-43db-b60c-fa8513021785'
     sip_name = 'test1'
     info = transfer.get_status(AM_URL, USER, API_KEY, sip_uuid, 'ingest', session)
     assert isinstance(info, dict)
     assert info['status'] == 'USER_INPUT'
     assert info['type'] == 'SIP'
     assert info['name'] == sip_name
     assert info['uuid'] == sip_uuid
     assert info['directory'] == sip_name + '-' + sip_uuid
     assert info['path'] == '/var/archivematica/sharedDirectory/watchedDirectories/workFlowDecisions/selectFormatIDToolIngest/test1-f2248e2a-b593-43db-b60c-fa8513021785/'
Beispiel #4
0
 def test_get_status_transfer(self):
     transfer_uuid = 'dfc8cf5f-b5b1-408c-88b1-34215964e9d6'
     transfer_name = 'test1'
     info = transfer.get_status(AM_URL, USER, API_KEY, transfer_uuid, 'transfer', session)
     assert isinstance(info, dict)
     assert info['status'] == 'USER_INPUT'
     assert info['type'] == 'transfer'
     assert info['name'] == transfer_name
     assert info['uuid'] == transfer_uuid
     assert info['directory'] == transfer_name
     assert info['path'] == '/var/archivematica/sharedDirectory/watchedDirectories/activeTransfers/standardTransfer/test1/'
Beispiel #5
0
 def test_get_status_transfer(self):
     transfer_uuid = "dfc8cf5f-b5b1-408c-88b1-34215964e9d6"
     transfer_name = "test1"
     info = transfer.get_status(
         AM_URL, USER, API_KEY, SS_URL, SS_USER, SS_KEY, transfer_uuid, "transfer"
     )
     assert isinstance(info, dict)
     assert info["status"] == "USER_INPUT"
     assert info["type"] == "transfer"
     assert info["name"] == transfer_name
     assert info["uuid"] == transfer_uuid
     assert info["directory"] == transfer_name
     assert info["path"] == (
         "/var/archivematica/sharedDirectory/"
         "watchedDirectories/activeTransfers/"
         "standardTransfer/test1/"
     )
Beispiel #6
0
 def test_get_status_ingest(self):
     sip_uuid = "f2248e2a-b593-43db-b60c-fa8513021785"
     sip_name = "test1"
     info = transfer.get_status(
         AM_URL, USER, API_KEY, SS_URL, SS_USER, SS_KEY, sip_uuid, "ingest"
     )
     assert isinstance(info, dict)
     assert info["status"] == "USER_INPUT"
     assert info["type"] == "SIP"
     assert info["name"] == sip_name
     assert info["uuid"] == sip_uuid
     assert info["directory"] == sip_name + "-" + sip_uuid
     assert info["path"] == (
         "/var/archivematica/sharedDirectory/"
         "watchedDirectories/workFlowDecisions/"
         "selectFormatIDToolIngest/"
         "test1-f2248e2a-b593-43db-b60c-fa8513021785/"
     )
    def test_get_status_transfer_to_ingest(self):
        # Reference values
        transfer_uuid = 'dfc8cf5f-b5b1-408c-88b1-34215964e9d6'
        unit_name = 'test1'
        sip_uuid = 'f2248e2a-b593-43db-b60c-fa8513021785'
        # Setup transfer in DB
        new_transfer = models.Unit(uuid=transfer_uuid, path=b'/foo', unit_type='transfer', status='PROCESSING', current=True)
        session.add(new_transfer)
        session.commit()

        # Run test
        info = transfer.get_status(AM_URL, USER, API_KEY, transfer_uuid, 'transfer', session)
        # Verify
        assert isinstance(info, dict)
        assert info['status'] == 'USER_INPUT'
        assert info['type'] == 'SIP'
        assert info['name'] == unit_name
        assert info['uuid'] == sip_uuid
        assert info['directory'] == unit_name + '-' + sip_uuid
        assert info['path'] == '/var/archivematica/sharedDirectory/watchedDirectories/workFlowDecisions/selectFormatIDToolIngest/test1-f2248e2a-b593-43db-b60c-fa8513021785/'
 def test_get_status_no_unit(self):
     transfer_uuid = 'deadc0de-c0de-c0de-c0de-deadc0dec0de'
     info = transfer.get_status(AM_URL, USER, API_KEY, SS_URL, SS_USER,
                                SS_KEY, transfer_uuid, 'transfer', session)
     self.assertEqual(info,
                      errors.error_lookup(errors.ERR_INVALID_RESPONSE))
 def test_get_status_not_json(self):
     transfer_uuid = 'dfc8cf5f-b5b1-408c-88b1-34215964e9d6'
     info = transfer.get_status(AM_URL, USER, API_KEY, SS_URL, SS_USER,
                                SS_KEY, transfer_uuid, 'transfer', session)
     self.assertEqual(info,
                      errors.error_lookup(errors.ERR_INVALID_RESPONSE))
Beispiel #10
0
 def test_get_status_not_json(self):
     transfer_uuid = 'dfc8cf5f-b5b1-408c-88b1-34215964e9d6'
     info = transfer.get_status(AM_URL, USER, API_KEY, transfer_uuid, 'transfer', session)
     assert info is None
Beispiel #11
0
 def test_get_status_no_unit(self):
     transfer_uuid = 'deadc0de-c0de-c0de-c0de-deadc0dec0de'
     info = transfer.get_status(AM_URL, USER, API_KEY, transfer_uuid, 'transfer', session)
     assert info is None
 def test_get_status_not_json(self):
     transfer_uuid = "dfc8cf5f-b5b1-408c-88b1-34215964e9d6"
     info = transfer.get_status(
         AM_URL, USER, API_KEY, SS_URL, SS_USER, SS_KEY, transfer_uuid, "transfer"
     )
     self.assertEqual(info, errors.error_lookup(errors.ERR_INVALID_RESPONSE))
 def test_get_status_no_unit(self):
     transfer_uuid = "deadc0de-c0de-c0de-c0de-deadc0dec0de"
     info = transfer.get_status(
         AM_URL, USER, API_KEY, SS_URL, SS_USER, SS_KEY, transfer_uuid, "transfer"
     )
     self.assertEqual(info, errors.error_lookup(errors.ERR_INVALID_RESPONSE))