- Timestamp:
- Feb 18, 2014 1:47:42 PM (11 years ago)
- 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 8599f56
- Parents:
- 7eb3aa2
- Location:
- test/sansdataloader/test
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sansdataloader/test/isis_1_1_write_test.xml
r75eeb425 rc6ca23d 1 1 <?xml version="1.0" ?> 2 <SASroot version="1.1" xmlns="urn:cansas1d:1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:cansas1d:1.1 http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd"> 2 <?xml-stylesheet type="text/xsl" href="cansasxml-html.xsl"?> 3 <SASroot version="1.1" xmlns="urn:cansas1d:1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:cansas1d:1.1 http://www.cansas.org/formats/1.1/cansas1d.xsd"> 3 4 <SASentry> 4 5 <Title> -
test/sansdataloader/test/utest_cansas.py
r76cd1ae rc6ca23d 89 89 self.assertTrue(data.detector[0].distance == 575.0) 90 90 self.assertTrue(data.detector[1].distance == 4145.02) 91 self.assertTrue(data.process[0].name == "Mantid generated CanSAS1D XML") 92 93 94 def _check_data_1_1(self, data): 91 95 spectrum = data.trans_spectrum[0] 92 96 self.assertTrue(len(spectrum.wavelength) == 138) 93 self.assertTrue(data.process[0].name == "Mantid generated CanSAS1D XML")94 97 95 98 96 99 def test_cansas_xml(self): 97 100 filename = "isis_1_1_write_test.xml" … … 105 108 for i in range(len(dataloader)): 106 109 self._check_data(dataloader[i]) 110 self._check_data_1_1(dataloader[i]) 107 111 self._check_data(cansasreader[i]) 112 self._check_data_1_1(cansasreader[i]) 108 113 reader_generic.save(filename, dataloader[i], None) 109 114 reader2 = Reader() … … 161 166 self.assertTrue(reader4.validateXML()) 162 167 168 169 def test_save_cansas_v1_0(self): 170 filename = "isis_1_0_write_test.xml" 171 xmlreader = XMLreader(self.isis_1_0, self.schema_1_0) 172 valid = xmlreader.validateXML() 173 self.assertTrue(valid) 174 reader_generic = Loader() 175 dataloader = reader_generic.load(self.isis_1_0) 176 reader_cansas = Reader() 177 cansasreader = reader_cansas.read(self.isis_1_0) 178 for i in range(len(dataloader)): 179 self._check_data(dataloader[i]) 180 self._check_data(cansasreader[i]) 181 reader_generic.save(filename, dataloader[i], None) 182 reader2 = Reader() 183 return_data = reader2.read(filename) 184 data_new = return_data 185 written_data = return_data[0] 186 self._check_data(written_data) 187 163 188 164 189 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.