Index: Source/Pythontest/TestInput.py
===================================================================
--- Source/Pythontest/TestInput.py	(revision ba9923062b4af98cbdd20c4101c305766fc728f5)
+++ Source/Pythontest/TestInput.py	(revision 76c37a99c13dbe456f0aa5adcf7439778e84a4c3)
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
@@ -6,7 +6,7 @@
 import pytest
 
-sys.path.append('../python')
-from classes.ControlFile import ControlFile
-from mods.tools import get_cmdline_arguments
+sys.path.append('../Python')
+from Classes.ControlFile import ControlFile
+from Mods.tools import get_cmdline_args
 
 
@@ -21,5 +21,6 @@
     # 2. check of parameter
 
-    def __init__(self):
+    @classmethod
+    def setup_class(self):
         # Default values for ArgumentParser
         self.args = {'start_date':None,
@@ -36,5 +37,5 @@
                      'job_template':'job.temp',
                      'queue':None,
-                     'controlfile':'CONTROL.temp',
+                     'controlfile':'CONTROL.test',
                      'debug':0,
                      }
@@ -43,7 +44,7 @@
         sys.argv = ['dummy.py', '--start_date=20180101']
 
-        self.args = tools.get_commandline_arguments()
+        self.args = get_cmdline_args()
 
-        self.c = ControlFile('TestData/CONTROL.temp')
+        self.c = ControlFile('../../Testing/Regression/Unit/Testfiles/CONTROL.test')
 
         self.c.assign_args_to_control(self.args)
@@ -57,5 +58,5 @@
                     '--step=0/to/11/BY/3', '--area=20./20./0./90.']
 
-        arguments = tools.get_cmdline_arguments()
+        arguments = get_cmdline_args()
 
         args_exp = {'start_date':'20180101',
@@ -72,5 +73,5 @@
                     'job_template':'job.temp',
                     'queue':None,
-                    'controlfile':'CONTROL.temp',
+                    'controlfile':'CONTROL.test',
                     'debug':1,
                     }
@@ -89,5 +90,5 @@
                     'area': None,
                     'basetime': None,
-                    'controlfile': 'CONTROL.temp',
+                    'controlfile': 'CONTROL.test',
                     'cwc': 0,
                     'date_chunk': 3,
@@ -158,2 +159,7 @@
 
         return
+
+    @classmethod
+    def teardown_class(self):
+ 
+        return
Index: Source/Pythontest/TestInstall.py
===================================================================
--- Source/Pythontest/TestInstall.py	(revision ba9923062b4af98cbdd20c4101c305766fc728f5)
+++ Source/Pythontest/TestInstall.py	(revision 76c37a99c13dbe456f0aa5adcf7439778e84a4c3)
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
@@ -11,16 +11,20 @@
 import shutil
 from genshi.template import TemplateLoader
-from genshi.template.eval import  UndefinedError
-from exceptions import OSError
+from genshi.template.eval import UndefinedError
+
+try:
+    import exceptions
+except ImportError:
+    import builtins
 import pytest
 from mock import patch
 
-sys.path.append('../python')
+sys.path.append('../Python')
 import _config
-import _config_test
+from . import _config_test
 from install import (mk_tarball, un_tarball, mk_env_vars, mk_compilejob,
                      mk_job_template)
 
-from mods.tools import make_dir, silent_remove
+from Mods.tools import make_dir, silent_remove
 
 #    - main
@@ -44,6 +48,6 @@
 
         # un tar the test tarballs from shell script
-        subprocess.check_output([os.path.join(self.testinstalldir,
-                                              'un_install_tar.sh')])
+#        subprocess.check_output([os.path.join(self.testinstalldir,
+#                                            'un_install_tar.sh')])
 
 
@@ -56,6 +60,4 @@
         tarballname = _config.FLEXEXTRACT_DIRNAME + '_localtest.tar'
 
-        with pytest.raises(SystemExit):
-            mk_tarball(ecd + tarballname, 'local')
         with pytest.raises(SystemExit):
             mk_tarball(ecd + tarballname, 'local')
@@ -78,5 +80,5 @@
 
         # remove test tar file from flex_extract directory
-        os.remove(ecd + tarballname)
+        #os.remove(ecd + tarballname)
 
         # test if comparison filelist is equal to the
@@ -310,21 +312,21 @@
         test_dir = os.path.join(self.testinstalldir,
                                 _config.FLEXEXTRACT_DIRNAME + '_local')
-        shutil.rmtree(test_dir)
+#        shutil.rmtree(test_dir)
         test_dir = os.path.join(self.testinstalldir,
                                 _config.FLEXEXTRACT_DIRNAME + '_ecgate')
-        shutil.rmtree(test_dir)
+#        shutil.rmtree(test_dir)
 
         test_dir = os.path.join(self.testinstalldir,
                                 'test_local')
-        shutil.rmtree(test_dir)
+#        shutil.rmtree(test_dir)
         test_dir = os.path.join(self.testinstalldir,
                                 'test_ecgate')
-        shutil.rmtree(test_dir)
+#        shutil.rmtree(test_dir)
 
         tar_file = os.path.join(self.testinstalldir,
                      _config.FLEXEXTRACT_DIRNAME + '_local.tar')
-        os.remove(tar_file)
+#        os.remove(tar_file)
         tar_file = os.path.join(self.testinstalldir,
                                 _config.FLEXEXTRACT_DIRNAME + '_ecgate.tar')
-        os.remove(tar_file)
+#        os.remove(tar_file)
         pass
Index: Source/Pythontest/TestTools.py
===================================================================
--- Source/Pythontest/TestTools.py	(revision ba9923062b4af98cbdd20c4101c305766fc728f5)
+++ Source/Pythontest/TestTools.py	(revision 76c37a99c13dbe456f0aa5adcf7439778e84a4c3)
@@ -7,7 +7,13 @@
 import sys
 import errno
-from exceptions import OSError
+#from exceptions import OSError
 import subprocess
 import pipes
+
+try:
+    import exceptions
+except ImportError:
+    import builtins
+
 import pytest
 from mock import patch, call
@@ -16,7 +22,7 @@
 
 import _config
-import _config_test
-from classes.ControlFile import ControlFile
-from mods.tools import (none_or_str, none_or_int, get_cmdline_arguments,
+from . import _config_test
+from Classes.ControlFile import ControlFile
+from Mods.tools import (none_or_str, none_or_int, get_cmdline_args,
                         read_ecenv, clean_up, my_error, send_mail,
                         normal_exit, product, silent_remove,
@@ -25,6 +31,5 @@
 
 class TestTools(object):
-    '''
-    '''
+    """Test the tools module."""
 
     def setup_method(self):
@@ -48,49 +53,54 @@
         sys.argv = ['dummy.py', '--wrong=1']
         with pytest.raises(SystemExit):
-            results = get_cmdline_arguments()
+            results = get_cmdline_args()
 
     def test_default_get_cmdline_arguments(self):
-        cmd_dict_control = {'start_date':None,
-                            'end_date':None,
-                            'date_chunk':None,
-                            'basetime':None,
-                            'step':None,
-                            'levelist':None,
-                            'area':None,
-                            'inputdir':None,
-                            'outputdir':None,
-                            'flexpart_root_scripts':None,
-                            'ppid':None,
-                            'job_template':'job.temp',
-                            'queue':None,
-                            'controlfile':'CONTROL.temp',
-                            'debug':None,
-                            'public':None,
-                            'request':None}
+        cmd_dict_control = {'start_date': None,
+                            'end_date': None,
+                            'date_chunk': None,
+                            'basetime': None,
+                            'step': None,
+                            'levelist': None,
+                            'area': None,
+                            'inputdir': None,
+                            'outputdir': None,
+                            'job_template': None,
+                            'job_chunk': None,
+                            'ppid': None,
+                            'job_template': 'job.temp',
+                            'queue': None,
+                            'controlfile': 'CONTROL_EA5',
+                            'debug': None,
+                            'public': None,
+                            'request': None,
+                            'oper': None,
+                            'rrint': None}
 
         sys.argv = ['dummy.py']
 
-        results = get_cmdline_arguments()
+        results = get_cmdline_args()
 
         assert cmd_dict_control == vars(results)
 
     def test_input_get_cmdline_arguments(self):
-        cmd_dict_control = {'start_date':'20180101',
-                            'end_date':'20180101',
-                            'date_chunk':3,
-                            'basetime':12,
-                            'step':'1',
-                            'levelist':'1/to/10',
-                            'area':'50/10/60/20',
-                            'inputdir':'../work',
-                            'outputdir':None,
-                            'flexpart_root_scripts':'../',
-                            'ppid':1234,
-                            'job_template':'job.sh',
-                            'queue':'ecgate',
-                            'controlfile':'CONTROL.WORK',
-                            'debug':1,
-                            'public':None,
-                            'request':0}
+        cmd_dict_control = {'start_date': '20180101',
+                            'end_date': '20180101',
+                            'date_chunk': 3,
+                            'basetime': 12,
+                            'step': '1',
+                            'levelist': '1/to/10',
+                            'area': '50/10/60/20',
+                            'inputdir': '../work',
+                            'outputdir': None,
+                            'ppid': '1234',
+                            'job_template': 'job.sh',
+                            'queue': 'ecgate',
+                            'controlfile': 'CONTROL.WORK',
+                            'debug': 1,
+                            'public': None,
+                            'request': 0,
+                            'rrint': 0,
+                            'job_chunk': None,
+                            'oper': 0}
 
         sys.argv = ['dummy.py',
@@ -104,5 +114,4 @@
                     '--inputdir=../work',
                     '--outputdir=None',
-                    '--flexpart_root_scripts=../',
                     '--ppid=1234',
                     '--job_template=job.sh',
@@ -111,7 +120,10 @@
                     '--debug=1',
                     '--public=None',
-                    '--request=0']
-
-        results = get_cmdline_arguments()
+                    '--request=0',
+                    '--rrint=0',
+                    '--job_chunk=None',
+                    '--oper=0']
+
+        results = get_cmdline_args()
 
         assert cmd_dict_control == vars(results)
@@ -121,8 +133,8 @@
         expected_sample = {'078': 'TCLW', '130': 'T', '034': 'SST'}
         # check a sample of parameters which must have been read in
-        assert all((k in table128 and table128[k]==v)
-                   for k,v in expected_sample.iteritems())
-
-    @patch('__builtin__.open', side_effect=[OSError(errno.EEXIST)])
+        assert all((k in table128 and table128[k] == v)
+                   for k, v in expected_sample.items())
+
+    @patch('builtins.open', side_effect=[OSError(errno.EEXIST)])
     def test_fail_open_init128(self, mock_openfile):
         with pytest.raises(SystemExit):
@@ -145,8 +157,8 @@
 
     @patch('traceback.format_stack', return_value='empty trace')
-    @patch('mods.tools.send_mail', return_value=0)
+    @patch('Mods.tools.send_mail', return_value=0)
     def test_success_my_error(self, mock_mail, mock_trace, capfd):
         with pytest.raises(SystemExit):
-            my_error(['any_user'], 'Failed!')
+            my_error('Failed!')
             out, err = capfd.readouterr()
             assert out == "Failed!\n\nempty_trace\n"
@@ -160,5 +172,5 @@
         send_mail(['${USER}', 'any_user'], 'ERROR', message='error mail')
         out, err = capfd.readouterr()
-        assert out == b'Email sent to user\nEmail sent to user\n'
+        assert out == 'Email sent to user\nEmail sent to user\n'
 
     @patch('subprocess.Popen')
@@ -169,5 +181,5 @@
         send_mail(['any-user'], 'ERROR', message='error mail')
         out, err = capfd.readouterr()
-        assert out == b'Email sent to any_user\n'
+        assert out == 'Email sent to any_user\n'
 
     @patch('subprocess.Popen', side_effect=[ValueError, OSError])
@@ -189,5 +201,5 @@
         assert envs_ref == envs
 
-    @patch('__builtin__.open', side_effect=[OSError(errno.EPERM)])
+    @patch('builtins.open', side_effect=[OSError(errno.EPERM)])
     def test_fail_read_ecenv(self, mock_open):
         with pytest.raises(SystemExit):
@@ -195,5 +207,5 @@
 
     @patch('glob.glob', return_value=[])
-    @patch('mods.tools.silent_remove')
+    @patch('Mods.tools.silent_remove')
     def test_empty_clean_up(self, mock_rm, mock_clean):
         clean_up(self.c)
@@ -203,10 +215,5 @@
     @patch('os.remove', return_value=0)
     def test_success_clean_up(self, mock_rm, mock_glob):
-        # ectrans=0; ecstorage=0; ecapi=None; prefix not in filename
-        clean_up(self.c)
-        mock_rm.assert_has_calls([call('any_file'), call('EIfile')])
-        mock_rm.reset_mock()
-
-        # ectrans=0; ecstorage=0; ecapi=False; prefix in filename
+
         self.c.prefix = 'EI'
         self.c.ecapi = False
@@ -215,35 +222,4 @@
         mock_rm.reset_mock()
 
-        # ectrans=0; ecstorage=0; ecapi=True; prefix in filename
-        self.c.prefix = 'EI'
-        self.c.ecapi = True
-        clean_up(self.c)
-        mock_rm.assert_has_calls([call('any_file')])
-        mock_rm.reset_mock()
-
-        # ectrans=1; ecstorage=0; ecapi=True; prefix in filename
-        self.c.prefix = 'EI'
-        self.c.ecapi = True
-        self.c.ectrans = 1
-        clean_up(self.c)
-        mock_rm.assert_has_calls([call('any_file')])
-        mock_rm.reset_mock()
-
-        # ectrans=1; ecstorage=0; ecapi=False; prefix in filename
-        self.c.prefix = 'EI'
-        self.c.ecapi = False
-        self.c.ectrans = 1
-        clean_up(self.c)
-        mock_rm.assert_has_calls([call('any_file'), call('EIfile')])
-        mock_rm.reset_mock()
-
-        # ectrans=1; ecstorage=1; ecapi=False; prefix in filename
-        self.c.prefix = 'EI'
-        self.c.ecapi = False
-        self.c.ectrans = 1
-        self.c.ecstorage = 1
-        clean_up(self.c)
-        mock_rm.assert_has_calls([call('any_file'), call('EIfile')])
-        mock_rm.reset_mock()
 
     def test_default_normal_exit(self, capfd):
Index: Source/Pythontest/TestUIOFiles.py
===================================================================
--- Source/Pythontest/TestUIOFiles.py	(revision ba9923062b4af98cbdd20c4101c305766fc728f5)
+++ Source/Pythontest/TestUIOFiles.py	(revision 76c37a99c13dbe456f0aa5adcf7439778e84a4c3)
@@ -5,43 +5,56 @@
 import sys
 import pytest
+from mock import patch
 
-sys.path.append('../python')
-from classes.UioFiles import UioFiles
+from . import _config_test
+sys.path.append('../Python')
+
+from Classes.UioFiles import UioFiles
 
 
 class TestUioFiles():
-    '''
-    Test class to test the UIOFiles methods.
-    '''
+    """Test class to test the UIOFiles methods."""
+
+    @classmethod
+    def setup_class(self):
+        """Setup status"""
+        self.testpath = os.path.join(_config_test.PATH_TEST_DIR, 'Dir')
+        # Initialise and collect filenames
+        self.files = UioFiles(self.testpath, '*.grb')
 
     def test_listFiles(self):
-        '''
-        @Description:
-            Test the listFiles method from class UIOFiles.
+        """Test the listFiles method from class UIOFiles."""
+        # set comparison information
+        self.expected = ['FCGG__SL.20160410.40429.16424.grb',
+                         'FCOG__ML.20160410.40429.16424.grb',
+                         'FCSH__ML.20160410.40429.16424.grb',
+                         'OG_OROLSM__SL.20160410.40429.16424.grb',
+                         'FCOG_acc_SL.20160409.40429.16424.grb',
+                         'FCOG__SL.20160410.40429.16424.grb',
+                         'FCSH__SL.20160410.40429.16424.grb']
 
-        @Input:
-            self: instance of TestClass
-                Class to test the UIOFiles methods.
-
-        @Return:
-            <nothing>
-        '''
-        # set comparison information
-        self.testpath = os.path.join(os.path.dirname(__file__), 'TestDir')
-        self.expected = ['FCGG__SL.20160410.40429.16424.grb',
-                             'FCOG__ML.20160410.40429.16424.grb',
-                             'FCSH__ML.20160410.40429.16424.grb',
-                             'OG_OROLSM__SL.20160410.40429.16424.grb',
-                             'FCOG_acc_SL.20160409.40429.16424.grb',
-                             'FCOG__SL.20160410.40429.16424.grb',
-                             'FCSH__SL.20160410.40429.16424.grb']
-
-        # Initialise and collect filenames
-        files = UioFiles(self.testpath, '*.grb')
         # get the basename to just check for equality of filenames
-        filelist = [os.path.basename(f) for f in files.files]
+        filelist = [os.path.basename(f) for f in self.files.files]
         # comparison of expected filenames against the collected ones
         assert sorted(self.expected) == sorted(filelist)
 
-        return
 
+    def test_delete_files(self):
+        """Test if a file is deleted."""
+        testfile = os.path.join(self.testpath, 'test.test')
+        open(testfile, 'w').close()
+        iofile = UioFiles(testfile, 'test.test')
+        iofile.delete_files()
+        assert [] == UioFiles(testfile, 'test.test').files
+
+
+    def test_str_(self):
+        """Test if list of file is correctly converted to string."""
+        self.expected = "FCSH__SL.20160410.40429.16424.grb, "\
+                        "FCSH__ML.20160410.40429.16424.grb, "\
+                        "FCOG__SL.20160410.40429.16424.grb, "\
+                        "FCOG__ML.20160410.40429.16424.grb, "\
+                        "OG_OROLSM__SL.20160410.40429.16424.grb, "\
+                        "FCGG__SL.20160410.40429.16424.grb, "\
+                        "FCOG_acc_SL.20160409.40429.16424.grb"
+        assert self.expected == self.files.__str__()
Index: Source/Pythontest/_config_test.py
===================================================================
--- Source/Pythontest/_config_test.py	(revision ba9923062b4af98cbdd20c4101c305766fc728f5)
+++ Source/Pythontest/_config_test.py	(revision 76c37a99c13dbe456f0aa5adcf7439778e84a4c3)
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 '''
@@ -27,5 +27,5 @@
 import sys
 
-sys.path.append('../python')
+sys.path.append('../Python')
 import _config
 
@@ -38,5 +38,5 @@
 # DIRECTORY NAMES
 # ------------------------------------------------------------------------------
-TEST_DIR = 'test/Unit'
+TEST_DIR = 'Testing/Regression/Unit'
 TESTFILES_DIR = 'Testfiles'
 TESTINSTALL_DIR = 'InstallTar'
Index: Source/Pythontest/conftest.py
===================================================================
--- Source/Pythontest/conftest.py	(revision ba9923062b4af98cbdd20c4101c305766fc728f5)
+++ Source/Pythontest/conftest.py	(revision 76c37a99c13dbe456f0aa5adcf7439778e84a4c3)
@@ -2,5 +2,5 @@
 import pytest
 
-sys.path.append('../python')
+sys.path.append('../Python')
 import _config
 
@@ -8,3 +8,3 @@
 #def prep_test_env():
 #    testdir = _config.PATH_TEST_DIR
-print ''
+print('')
