Logo Search packages:      
Sourcecode: python-biopython version File versions  Download package

def test_GenomeDiagram::DiagramTest::test_write_arguments (   self )
Check how the write methods respond to output format arguments.

Definition at line 475 of file test_GenomeDiagram.py.

                                  :
        """Check how the write methods respond to output format arguments."""
        gdd = Diagram('Test Diagram')
        gdd.drawing = None #Hack - need the ReportLab drawing object to be created.
        filename = os.path.join("Graphics","error.txt")
        #We (now) allow valid formats in any case.
        for output in ["XXX","xxx",None,123,5.9]:
            try:
                gdd.write(filename, output)
                assert False, \
                       "Should have rejected %s as an output format" % output
            except ValueError, e:
                #Good!
                pass
            try:
                gdd.write_to_string(output)
                assert False, \
                       "Should have rejected %s as an output format" % output
            except ValueError, e:
                #Good!
                pass


Generated by  Doxygen 1.6.0   Back to index