예제 #1
0
파일: tests.py 프로젝트: sadrians/st26proto
    def test_helper_generateXml(self):
        print 'Running %s ...' % getName()
        
        sequenceListing = self.sequenceListingFixture.create_sequencelisting_instance()
        self.sequenceListingFixture.create_sequence_instance(sequenceListing)
#         TODO: generate some fancy sequences to check xml validation?
        util.helper_generateXml(sequenceListing)
        
        f =  os.path.join(util.OUTPUT_DIR, '%s.xml' % sequenceListing.fileName)

        self.assertTrue(util.validateDocumentWithSchema(f, util.XML_SCHEMA_PATH))
        self.assertTrue(util.validateDocumentWithDtd(f, util.XML_DTD_PATH))
        sequenceListing.delete()
예제 #2
0
파일: views.py 프로젝트: sadrians/st26proto
def generateXml(request, pk):
        sl = SequenceListing.objects.all().get(pk=pk)
        sl.productionDate = timezone.now()
        sl.save()
        
#         generate xml and write it to file system
        util.helper_generateXml(sl)
        
        xmlFilePath = 'sequencelistings/output/%s.xml' % sl.fileName
        
        logger.info('Generated xml seql at %s.' %xmlFilePath)
        
        return render(request, 'sequencelistings/xmloutput.html', 
                      {'filePath': xmlFilePath, 
                        'location': util.OUTPUT_DIR, 
                        'fileName': sl.fileName,
                        }) 
예제 #3
0
    def test_helper_generateXml(self):
        print 'Running %s ...' % getName()

        sequenceListing = self.sequenceListingFixture.create_sequencelisting_instance(
        )
        self.sequenceListingFixture.create_sequence_instance(sequenceListing)
        # TODO: generate some fancy sequences to check xml validation?
        util.helper_generateXml(sequenceListing)

        f = os.path.join(util.OUTPUT_DIR, '%s.xml' % sequenceListing.fileName)

        res = util.validateDocumentWithSchema(f, util.XML_SCHEMA_PATH)
        self.assertIsNone(res['parserError'])
        self.assertIsNone(res['schemaError'])

        self.assertTrue(util.validateDocumentWithDtd(f, util.XML_DTD_PATH))
        sequenceListing.delete()  # TODO: shouldn't be in teardown?
예제 #4
0
def generateXml(request, pk):
    sl = SequenceListing.objects.all().get(pk=pk)
    sl.productionDate = timezone.now()
    sl.save()

    #         generate xml and write it to file system
    util.helper_generateXml(sl)

    xmlFilePath = 'sequencelistings/output/%s.xml' % sl.fileName

    logger.info('Generated xml seql at %s.' % xmlFilePath)

    return render(
        request,
        'sequencelistings/xmloutput.html',
        {
            'filePath': xmlFilePath,
            'location': util.OUTPUT_DIR,
            'fileName': sl.
            fileName,  # can be obtained in the template from sequencelisting!!!!
            'sequencelisting': sl,
        })