Ignore:
Timestamp:
21 Mar 2012, 13:50:16 (13 years ago)
Author:
Henrik Bettermann
Message:

Rename importers to processors.

Location:
main/waeup.custom/trunk/src/waeup/custom
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.custom/trunk/src/waeup/custom/applicants/batching.py

    r7853 r7934  
    2020
    2121import grok
    22 from waeup.kofa.applicants.batching import ApplicantImporter
     22from waeup.kofa.applicants.batching import ApplicantProcessor
    2323from waeup.custom.applicants.interfaces import IPGApplicant
    2424
    25 class PGApplicantImporter(ApplicantImporter):
     25class PGApplicantProcessor(ApplicantProcessor):
    2626    """A batch processor for IPGApplicant objects.
    2727    """
    28     util_name = 'pgapplicantimporter'
     28    util_name = 'pgapplicantprocessor'
    2929    grok.name(util_name)
    30     name = u'PG Applicant Importer'
     30    name = u'PG Applicant Processor'
    3131    iface = IPGApplicant
    3232    factory_name = 'waeup.PGApplicant'
  • main/waeup.custom/trunk/src/waeup/custom/applicants/tests.py

    r7866 r7934  
    3131from waeup.custom.applicants.container import PGApplicantsContainer
    3232from waeup.custom.applicants.applicant import PGApplicant
    33 from waeup.custom.applicants.batching import PGApplicantImporter
     33from waeup.custom.applicants.batching import PGApplicantProcessor
    3434from waeup.custom.applicants.interfaces import IPGApplicant, IPGApplicantEdit
    3535
     
    4040    '\n')[0].split(',')
    4141
    42 class PGApplicantImporterTest(FunctionalTestCase):
     42class PGApplicantProcessorTest(FunctionalTestCase):
    4343    """Perform some batching tests.
    4444    """
     
    4646
    4747    def setUp(self):
    48         super(PGApplicantImporterTest, self).setUp()
     48        super(PGApplicantProcessorTest, self).setUp()
    4949        # Setup a sample site for each test
    5050        app = University()
     
    8686        self.applicant = self.app['applicants']['pg2011'][
    8787            self.application_number]
    88         self.importer = PGApplicantImporter()
     88        self.processor = PGApplicantProcessor()
    8989        self.workdir = tempfile.mkdtemp()
    9090        self.csv_file = os.path.join(self.workdir, 'sample_applicant_data.csv')
     
    9292
    9393    def tearDown(self):
    94         super(PGApplicantImporterTest, self).tearDown()
     94        super(PGApplicantProcessorTest, self).tearDown()
    9595        shutil.rmtree(self.workdir)
    9696        shutil.rmtree(self.dc_root)
     
    100100    def test_interfaces(self):
    101101        # Make sure we fulfill the interface contracts.
    102         assert verifyObject(IBatchProcessor, self.importer) is True
     102        assert verifyObject(IBatchProcessor, self.processor) is True
    103103        assert verifyClass(
    104             IBatchProcessor, PGApplicantImporter) is True
     104            IBatchProcessor, PGApplicantProcessor) is True
    105105        assert verifyObject(IPGApplicant, self.applicant) is True
    106106        assert verifyClass(
     
    118118
    119119    def test_import(self):
    120         num, num_warns, fin_file, fail_file = self.importer.doImport(
     120        num, num_warns, fin_file, fail_file = self.processor.doImport(
    121121            self.csv_file, APPLICANT_HEADER_FIELDS)
    122122        self.assertEqual(num_warns,0)
  • main/waeup.custom/trunk/src/waeup/custom/interswitch/browser.py

    r7928 r7934  
    219219
    220220        # Add webservice validation
    221         validation_list = get_SOAP_response(
    222             PRODUCT_ID, self.context.p_id).split(':')
    223         # Validation does not make sense yet since the query string
    224         # formats are conflicting.
    225         print validation_list
     221        try:
     222            validation_list = get_SOAP_response(
     223                PRODUCT_ID, self.context.p_id).split(':')
     224            # Validation does not make sense yet since the query string
     225            # formats are conflicting. We are only printing the validation string,
     226            # nothing else.
     227            print validation_list
     228        except:
     229            print 'Connection to webservice failed.'
    226230
    227231        write_log_message(self,'valid callback: %s' % self.context.p_id)
  • main/waeup.custom/trunk/src/waeup/custom/students/tests/test_browser.py

    r7928 r7934  
    3535    '\n')[0].split(',')
    3636
    37 class StudentImporterTest(FunctionalTestCase):
     37class StudentProcessorTest(FunctionalTestCase):
    3838    """Perform some batching tests.
    3939    """
     
    4242
    4343    def setUp(self):
    44         super(StudentImporterTest, self).setUp()
     44        super(StudentProcessorTest, self).setUp()
    4545        # Setup a sample site for each test
    4646        app = University()
     
    5858        setSite(app)
    5959
    60         self.importer_base = StudentProcessorBase()
    61         self.importer = StudentProcessor()
     60        self.processor_base = StudentProcessorBase()
     61        self.processor = StudentProcessor()
    6262        self.workdir = tempfile.mkdtemp()
    6363        self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv')
     
    6565
    6666    def tearDown(self):
    67         super(StudentImporterTest, self).tearDown()
     67        super(StudentProcessorTest, self).tearDown()
    6868        shutil.rmtree(self.workdir)
    6969        shutil.rmtree(self.dc_root)
     
    7373    def test_import(self):
    7474        # We added empty columns 'nationality' and 'lga' to the import file.
    75         # The original importer will fail because these fields are required
     75        # The original processor will fail because these fields are required
    7676        # in the base package.
    77         num, num_warns, fin_file, fail_file = self.importer_base.doImport(
     77        num, num_warns, fin_file, fail_file = self.processor_base.doImport(
    7878            self.csv_file, STUDENT_HEADER_FIELDS)
    7979        self.assertEqual(num_warns,3)
    8080        assert len(self.app['students'].keys()) == 0
    81         # The customized importer does not complain since both fields are
     81        # The customized processor does not complain since both fields are
    8282        # not required in the custom package.
    83         num, num_warns, fin_file, fail_file = self.importer.doImport(
     83        num, num_warns, fin_file, fail_file = self.processor.doImport(
    8484            self.csv_file, STUDENT_HEADER_FIELDS)
    8585        self.assertEqual(num_warns,0)
Note: See TracChangeset for help on using the changeset viewer.