ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 2b310602 was
2b310602,
checked in by Adam Washington <adam.washington@…>, 7 years ago
|
Update SESANS reader to SESANS format v1.0
|
-
Property mode set to
100644
|
File size:
898 bytes
|
Rev | Line | |
---|
[2b310602] | 1 | """ |
---|
| 2 | Unit tests for the SESANS .ses reader |
---|
| 3 | """ |
---|
| 4 | |
---|
| 5 | import unittest |
---|
| 6 | from sas.sascalc.dataloader.loader import Loader |
---|
| 7 | |
---|
| 8 | import os.path |
---|
| 9 | |
---|
| 10 | class sesans_reader(unittest.TestCase): |
---|
| 11 | |
---|
| 12 | def setUp(self): |
---|
| 13 | self.loader = Loader() |
---|
| 14 | |
---|
| 15 | def test_sesans_load(self): |
---|
| 16 | """ |
---|
| 17 | Test .SES file loading |
---|
| 18 | """ |
---|
| 19 | f =self.loader.load("sphere3micron.ses") |
---|
| 20 | # self.assertEqual(f, 5) |
---|
| 21 | self.assertEqual(len(f.x), 40) |
---|
| 22 | self.assertEqual(f.x[0], 391.56) |
---|
| 23 | self.assertEqual(f.x[-1], 46099) |
---|
| 24 | self.assertEqual(f.y[-1], -0.19956) |
---|
| 25 | self.assertEqual(f.x_unit, "A") |
---|
| 26 | self.assertEqual(f.y_unit, "A-2 cm-1") |
---|
| 27 | self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O") |
---|
| 28 | self.assertEqual(f.sample.thickness, 0.2) |
---|
| 29 | self.assertEqual(f.sample.zacceptance, (0.0168, "radians")) |
---|
| 30 | |
---|
| 31 | if __name__ == "__main__": |
---|
| 32 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.