Changeset 56dac0b in sasview


Ignore:
Timestamp:
Sep 22, 2017 7:02:03 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
26183bf
Parents:
dc8d1c2
Message:

py3 doesn't have StringIO package

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/sasdataloader/test/utest_cansas.py

    r574adc7 r56dac0b  
    44import os 
    55import sys 
    6 import StringIO 
     6from io import StringIO 
    77import unittest 
    88import logging 
     
    5959        Should fail gracefully and send a message to logger.info() 
    6060        """ 
    61         invalid = StringIO.StringIO('<a><c></b></a>') 
     61        invalid = StringIO('<a><c></b></a>') 
    6262        self.assertRaises(XMLSyntaxError, lambda: XMLreader(invalid)) 
    6363 
     
    7171        string += "\t</xsd:complexType>\n" 
    7272        string += "</xsd:schema>" 
    73         f = StringIO.StringIO(string) 
     73        f = StringIO(string) 
    7474        xmlschema_doc = etree.parse(f) 
    7575        xmlschema = etree.XMLSchema(xmlschema_doc) 
    76         valid = etree.parse(StringIO.StringIO('<a><b></b></a>')) 
    77         invalid = etree.parse(StringIO.StringIO('<a><c></c></a>')) 
     76        valid = etree.parse(StringIO('<a><b></b></a>')) 
     77        invalid = etree.parse(StringIO('<a><c></c></a>')) 
    7878        self.assertTrue(xmlschema.validate(valid)) 
    7979        self.assertFalse(xmlschema.validate(invalid)) 
     
    211211            # find the processing instructions and make into a dictionary 
    212212            dic = self.get_processing_instructions(reader) 
    213             self.assertTrue(dic == {'xml-stylesheet': \ 
    214                                     'type="text/xsl" href="cansas1d.xsl" '}) 
     213            self.assertEqual(dic, {'xml-stylesheet': 
     214                                   'type="text/xsl" href="cansas1d.xsl" '}) 
    215215 
    216216            xml = "<test><a><b><c></c></b></a></test>" 
Note: See TracChangeset for help on using the changeset viewer.