Changeset cc62607 in sasview for test


Ignore:
Timestamp:
Dec 22, 2017 11:38:19 AM (7 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e3133dc
Parents:
8475d16
Message:

Add unit tests to show nan values are coerced to 0. refs #1037

Location:
test/sasdataloader/test
Files:
1 added
1 edited

Legend:

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

    rf53d684 rcc62607  
    55import os.path 
    66import warnings 
     7import math 
    78warnings.simplefilter("ignore") 
    89 
     
    110111            self.assertEqual(f, None) 
    111112 
     113    def test_nan_values(self): 
     114        """ 
     115        Test loading an ascii data file with nan values saved in x, y, or dy. 
     116        """ 
     117        f = self.loader.load(find("test_data_nan_values.dat"))[0] 
     118        for i in range(0, len(f.x) - 1): 
     119            self.assertFalse(math.isnan(f.x[i])) 
     120            self.assertFalse(math.isnan(f.y[i])) 
     121            self.assertFalse(math.isnan(f.dy[i])) 
     122 
     123 
    112124if __name__ == '__main__': 
    113125    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.