def test_no_exceptions(self): """Check that all test files are parsed without any Exception""" import os from common import open_pds testDataDir = '../../../test_data/' pdsparser = Parser(log="Parser_Unit_Tests") for root, dirs, files in os.walk(testDataDir): for name in files: filename = os.path.join(root, name) try: labels = pdsparser.parse(open_pds(filename)) # labels = pdsparser.labels # Old usage, depriciated. except Exception, e: # Re-raise the exception, causing this test to fail. raise else: # The following is executed if and when control flows off the end of the try clause. assert True
def test_no_exceptions(self): """Check that all test files are parsed without any Exception""" import os from common import open_pds testDataDir = '../../../test_data/' pdsparser = Parser(log="Parser_Unit_Tests") for root, dirs, files in os.walk(testDataDir): for name in files: filename = os.path.join(root, name) try: pdsparser.parse(open_pds(filename)) labels = pdsparser.labels except Exception, e: # Re-raise the exception, causing this test to fail. raise else: # The following is executed if and when control flows off the end of the try clause. assert True
def test_no_exceptions(self): """Check that all test files are read without any Exception""" import os from common import open_pds testDataDir = "../../../test_data/" pdsreader = Reader(log="Reader_Unit_Tests") for root, dirs, files in os.walk(testDataDir): for name in files: filename = os.path.join(root, name) try: for record in pdsreader.read(open_pds(filename)): # print record pass except Exception, e: # Re-raise the exception, causing this test to fail. raise else: # The following is executed if and when control flows off the end of the try clause. assert True
def test_no_exceptions(self): """Check that all test files are read without any Exception""" import os from common import open_pds testDataDir = '../../../test_data/' pdsreader = Reader(log="Reader_Unit_Tests") for root, dirs, files in os.walk(testDataDir): for name in files: filename = os.path.join(root, name) try: for record in pdsreader.read(open_pds(filename)): #print record pass except Exception, e: # Re-raise the exception, causing this test to fail. raise else: # The following is executed if and when control flows off the end of the try clause. assert True
import os from common import open_pds testDataDir = '../../../test_data/' pdsparser = Parser(log="Parser_Unit_Tests") for root, dirs, files in os.walk(testDataDir): for name in files: filename = os.path.join(root, name) try: labels = pdsparser.parse(open_pds(filename)) # labels = pdsparser.labels # Old usage, depriciated. except Exception, e: # Re-raise the exception, causing this test to fail. raise else: # The following is executed if and when control flows off the end of the try clause. assert True if __name__ == '__main__': # unittest.main() from common import open_pds filename = '../../../test_data/FHA01118.LBL' pdsparser = Parser() labels = pdsparser.parse(open_pds(filename)) # labels = pdsparser.labels # Old usage, depriciated. print labels.keys() print labels['IMAGE END']
"""Check that all test files are parsed without any Exception""" import os from common import open_pds testDataDir = '../../../test_data/' pdsparser = Parser(log="Parser_Unit_Tests") for root, dirs, files in os.walk(testDataDir): for name in files: filename = os.path.join(root, name) try: pdsparser.parse(open_pds(filename)) labels = pdsparser.labels except Exception, e: # Re-raise the exception, causing this test to fail. raise else: # The following is executed if and when control flows off the end of the try clause. assert True if __name__ == '__main__': unittest.main() from common import open_pds filename = '../../../test_data/FHA01118.LBL' pdsparser = Parser() pdsparser.parse(open_pds(filename)) labels = pdsparser.labels print labels.keys() print labels['IMAGE END']