From 565fd937e0ca090a8edaad8475a0c590cb2bc6de Mon Sep 17 00:00:00 2001
From: Anne Philipp <anne.philipp@univie.ac.at>
Date: Fri, 7 Dec 2018 16:20:52 +0100
Subject: [PATCH] added test class for EcFlexpart unit tests

---
 source/pythontest/TestEcFlexpart.py | 56 +++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 source/pythontest/TestEcFlexpart.py

diff --git a/source/pythontest/TestEcFlexpart.py b/source/pythontest/TestEcFlexpart.py
new file mode 100644
index 0000000..046835e
--- /dev/null
+++ b/source/pythontest/TestEcFlexpart.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+import sys
+import os
+import inspect
+import pytest
+
+sys.path.append('../python')
+import _config
+from classes.EcFlexpart import EcFlexpart
+from classes.ControlFile import ControlFile
+from mods.tools import silent_remove
+
+class TestEcFlexpart():
+    '''
+    '''
+
+    def test_write_namelist(self):
+        import filecmp
+
+        control_file = os.path.join(_config.PATH_TEST_DIR,
+                                        'TestData',
+                                        'CONTROL.temp')
+        c = ControlFile(control_file)
+        flexpart = EcFlexpart(c)
+
+        c.inputdir = 'TestData'
+
+        # comparison file
+        testfile = os.path.join(_config.PATH_TEST_DIR,
+                                'TestData',
+                                'convert.nl.test')
+
+        # create
+        flexpart.write_namelist(c)
+
+        finalfile = os.path.join(c.inputdir, _config.FILE_NAMELIST)
+        assert filecmp.cmp(testfile, finalfile, shallow=False)
+
+        # delete test file
+        silent_remove(finalfile)
+
+
+
+
+# these functions should test the output and compare the results with an output
+# of the old version and check if there are no differences!!!
+# also check for errors?! Or check if it works for alle datasets and private public etc
+
+    #    - process_output
+    #    - create
+    #    - deacc_fluxes
+    #    - retrieve
+
-- 
GitLab