source: flex_extract.git/source/pythontest/TestUIOFiles.py @ 25b14be

ctbtodev
Last change on this file since 25b14be was 25b14be, checked in by Anne Philipp <anne.philipp@…>, 6 years ago

changed whole tree structure of flex_extract to have better overview

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import os
5import sys
6import pytest
7
8sys.path.append('../python')
9from classes.UioFiles import UioFiles
10
11
12class TestUioFiles():
13    '''
14    Test class to test the UIOFiles methods.
15    '''
16
17    def test_listFiles(self):
18        '''
19        @Description:
20            Test the listFiles method from class UIOFiles.
21
22        @Input:
23            self: instance of TestClass
24                Class to test the UIOFiles methods.
25
26        @Return:
27            <nothing>
28        '''
29        # set comparison information
30        self.testpath = os.path.join(os.path.dirname(__file__), 'TestDir')
31        self.expected = ['FCGG__SL.20160410.40429.16424.grb',
32                             'FCOG__ML.20160410.40429.16424.grb',
33                             'FCSH__ML.20160410.40429.16424.grb',
34                             'OG_OROLSM__SL.20160410.40429.16424.grb',
35                             'FCOG_acc_SL.20160409.40429.16424.grb',
36                             'FCOG__SL.20160410.40429.16424.grb',
37                             'FCSH__SL.20160410.40429.16424.grb']
38
39        # Initialise and collect filenames
40        files = UioFiles(self.testpath, '*.grb')
41        # get the basename to just check for equality of filenames
42        filelist = [os.path.basename(f) for f in files.files]
43        # comparison of expected filenames against the collected ones
44        assert sorted(self.expected) == sorted(filelist)
45
46        return
47
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG