Ignore:
Timestamp:
Dec 5, 2017 12:31:07 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
5bb05a4
Parents:
3053a4a
git-author:
Stuart Prescott <llimeht@…> (12/05/17 12:31:07)
git-committer:
Paul Kienzle <pkienzle@…> (12/05/17 12:31:07)
Message:

Make tests work from any directory and functional without special runner script (#124)

File:
1 edited

Legend:

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

    rdcb91cf rf53d684  
    1313logger = logging.getLogger(__name__) 
    1414 
     15 
     16def find(filename): 
     17    return os.path.join(os.path.dirname(__file__), filename) 
     18 
     19 
    1520class ExtensionRegistryTests(unittest.TestCase): 
    1621 
    1722    def setUp(self): 
    18         self.valid_file = "valid_cansas_xml.xml" 
    19         self.valid_file_wrong_known_ext = "valid_cansas_xml.txt" 
    20         self.valid_file_wrong_unknown_ext = "valid_cansas_xml.xyz" 
     23        self.valid_file = find("valid_cansas_xml.xml") 
     24        self.valid_file_wrong_known_ext = find("valid_cansas_xml.txt") 
     25        self.valid_file_wrong_unknown_ext = find("valid_cansas_xml.xyz") 
    2126        shutil.copyfile(self.valid_file, self.valid_file_wrong_known_ext) 
    2227        shutil.copyfile(self.valid_file, self.valid_file_wrong_unknown_ext) 
    23         self.invalid_file = "cansas1d_notitle.xml" 
     28        self.invalid_file = find("cansas1d_notitle.xml") 
    2429 
    2530        self.loader = Loader() 
Note: See TracChangeset for help on using the changeset viewer.