Changeset b9d74f3 in sasview for src/sas/sascalc/data_util/registry.py
- Timestamp:
- Apr 20, 2017 6:29:34 AM (8 years ago)
- Children:
- 0cc77d8
- Parents:
- b636dfc5
- git-author:
- Andrew Nelson <andyfaff@…> (04/20/17 06:25:57)
- git-committer:
- Andrew Nelson <andyfaff@…> (04/20/17 06:29:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/registry.py
rb699768 rb9d74f3 105 105 # Raise an error if there are no matching extensions 106 106 if len(loaders) == 0: 107 raise ValueError , "Unknown file type for "+path107 raise ValueError("Unknown file type for "+path) 108 108 # All done 109 109 return loaders … … 159 159 try: reg.load('hello.cx2') 160 160 except CxError: pass # correct failure 161 else: raise AssertError ,"Incorrect error on load failure"161 else: raise AssertError("Incorrect error on load failure") 162 162 # Make sure the case of no loaders fails correctly 163 163 try: reg.load('hello.missing') 164 164 except ValueError,msg: 165 165 assert str(msg)=="Unknown file type for hello.missing",'Message: <%s>'%(msg) 166 else: raise AssertError ,"No error raised for missing extension"166 else: raise AssertError("No error raised for missing extension") 167 167 assert reg.formats() == ['new_cx'] 168 168 assert reg.extensions() == ['.cx','.cx.gz','.cx1','.cx1.gz','.cx2','.gz']
Note: See TracChangeset
for help on using the changeset viewer.