Hi Troels, As this is checking the operation of a single function of the lib.io module, this is really a unit test. It might fit better in the test_suite/unit_tests/_lib/test_io.py. Regards, Edward On 29 November 2014 at 00:04, <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet Date: Sat Nov 29 00:04:35 2014 New Revision: 26815 URL: http://svn.gna.org/viewcvs/relax?rev=26815&view=rev Log: Added systemtest Nmrglue.test_get_file_list to test getting a list of basenames and fileroots. Task #7873 (https://gna.org/task/index.php?7873): Write wrapper function to nmrglue, to read .ft2 files and process them. Homepage: http://www.nmrglue.com/ Link to nmrglue discussion: https://groups.google.com/forum/#!forum/nmrglue-discuss The code is develop at Github: https://github.com/jjhelmus/nmrglue/ Google code: https://code.google.com/p/nmrglue/ Documentation: http://nmrglue.readthedocs.org/en/latest/index.html Modified: branches/nmrglue/test_suite/system_tests/nmrglue.py Modified: branches/nmrglue/test_suite/system_tests/nmrglue.py URL: http://svn.gna.org/viewcvs/relax/branches/nmrglue/test_suite/system_tests/nmrglue.py?rev=26815&r1=26814&r2=26815&view=diff ============================================================================== --- branches/nmrglue/test_suite/system_tests/nmrglue.py (original) +++ branches/nmrglue/test_suite/system_tests/nmrglue.py Sat Nov 29 00:04:35 2014 @@ -26,7 +26,7 @@ # relax module imports. from data_store import Relax_data_store; ds = Relax_data_store() -from lib.io import file_root +from lib.io import file_root, get_file_list from pipe_control.nmrglue import plot_contour, plot_hist from status import Status; status = Status() from test_suite.system_tests.base_classes import SystemTestCase @@ -48,6 +48,23 @@ # Create path to nmrglue test data. ds.ng_test = status.install_path +sep+ 'extern' +sep+ 'nmrglue' +sep+ 'nmrglue_0_4' +sep+ 'tests' +sep+ 'pipe_proc_tests' + + + def test_get_file_list(self): + """Test getting a file list with glob.""" + + # Define base path to files. + base_path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'repeated_analysis'+sep+'SOD1' + + # Define folder to all ft files. + ft2_folder_1 = base_path +sep+ 'cpmg_disp_sod1d90a_060518' +sep+ 'cpmg_disp_sod1d90a_060518_normal.fid' +sep+ 'ft2_data' + + # Get the file list matching a glob pattern. + ft2_glob_pat = '128_*_FT.ft2' + basename_list, file_root_list = get_file_list(glob_pattern=ft2_glob_pat, dir=ft2_folder_1) + + self.assertEqual(basename_list, ['128_0_FT.ft2', '128_1_FT.ft2']) + self.assertEqual(file_root_list, ['128_0_FT', '128_1_FT']) def test_nmrglue_read(self): _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@xxxxxxx To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits