From f9f7b3f87c9b58853feb20f24e537cbd24b818b1 Mon Sep 17 00:00:00 2001 From: Anne Philipp <anne.philipp@univie.ac.at> Date: Sun, 2 Sep 2018 12:40:41 +0200 Subject: [PATCH] start using markers for testcases --- python/pythontest/TestTools.py | 8 ++++---- python/pythontest/pytest.ini | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 python/pythontest/pytest.ini diff --git a/python/pythontest/TestTools.py b/python/pythontest/TestTools.py index 7a3fc77..ad2dbff 100644 --- a/python/pythontest/TestTools.py +++ b/python/pythontest/TestTools.py @@ -3,7 +3,6 @@ import os import sys -#import unittest import subprocess import pipes import pytest @@ -117,11 +116,12 @@ class TestTools(): def test_make_dir(self): assert True + @pytest.mark.msuser def test_success_put_file_to_ecserver(self): - ecuid=os.environ['ECUID']#'km4a' - ecgid=os.environ['ECGID']#'at' + ecuid=os.environ['ECUID'] + ecgid=os.environ['ECGID'] put_file_to_ecserver('TestData/', 'testfile.txt', 'ecgate', ecuid, ecgid) - assert subprocess.call(['ssh', 'km4a@ecaccess.ecmwf.int' , + assert subprocess.call(['ssh', ecuid+'@ecaccess.ecmwf.int' , 'test -e ' + pipes.quote('/home/ms/'+ecgid+'/'+ecuid)]) == 0 diff --git a/python/pythontest/pytest.ini b/python/pythontest/pytest.ini new file mode 100644 index 0000000..301a45e --- /dev/null +++ b/python/pythontest/pytest.ini @@ -0,0 +1,4 @@ +# content of pytest.ini +[pytest] +markers = + memberstate: Test that can be executed only as a member-state user. Password required. \ No newline at end of file -- GitLab