Changeset 76c37a9 in flex_extract.git for Source/Pythontest/TestInput.py


Ignore:
Timestamp:
Dec 19, 2019, 8:11:12 PM (4 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
d720895
Parents:
d2b7217
Message:

updated unit tests to work with updated code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Source/Pythontest/TestInput.py

    rba99230 r76c37a9  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33
     
    66import pytest
    77
    8 sys.path.append('../python')
    9 from classes.ControlFile import ControlFile
    10 from mods.tools import get_cmdline_arguments
     8sys.path.append('../Python')
     9from Classes.ControlFile import ControlFile
     10from Mods.tools import get_cmdline_args
    1111
    1212
     
    2121    # 2. check of parameter
    2222
    23     def __init__(self):
     23    @classmethod
     24    def setup_class(self):
    2425        # Default values for ArgumentParser
    2526        self.args = {'start_date':None,
     
    3637                     'job_template':'job.temp',
    3738                     'queue':None,
    38                      'controlfile':'CONTROL.temp',
     39                     'controlfile':'CONTROL.test',
    3940                     'debug':0,
    4041                     }
     
    4344        sys.argv = ['dummy.py', '--start_date=20180101']
    4445
    45         self.args = tools.get_commandline_arguments()
     46        self.args = get_cmdline_args()
    4647
    47         self.c = ControlFile('TestData/CONTROL.temp')
     48        self.c = ControlFile('../../Testing/Regression/Unit/Testfiles/CONTROL.test')
    4849
    4950        self.c.assign_args_to_control(self.args)
     
    5758                    '--step=0/to/11/BY/3', '--area=20./20./0./90.']
    5859
    59         arguments = tools.get_cmdline_arguments()
     60        arguments = get_cmdline_args()
    6061
    6162        args_exp = {'start_date':'20180101',
     
    7273                    'job_template':'job.temp',
    7374                    'queue':None,
    74                     'controlfile':'CONTROL.temp',
     75                    'controlfile':'CONTROL.test',
    7576                    'debug':1,
    7677                    }
     
    8990                    'area': None,
    9091                    'basetime': None,
    91                     'controlfile': 'CONTROL.temp',
     92                    'controlfile': 'CONTROL.test',
    9293                    'cwc': 0,
    9394                    'date_chunk': 3,
     
    158159
    159160        return
     161
     162    @classmethod
     163    def teardown_class(self):
     164 
     165        return
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG