Awight has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342971 )

Change subject: 100% test coverage
......................................................................

100% test coverage

Change-Id: I80fc8f0abf20ec0d0f971f4da3762e4f7a41b448
---
M .gitignore
D tests/data/boot.yaml
A tests/data/which-out.yaml
M tests/test_job_wrapper.py
4 files changed, 22 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/process-control 
refs/changes/71/342971/1

diff --git a/.gitignore b/.gitignore
index 1a0929d..d503969 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 *.pyc
 .cache
+cover
+.coverage
 .tox
diff --git a/tests/data/boot.yaml b/tests/data/boot.yaml
deleted file mode 100644
index 8ae5294..0000000
--- a/tests/data/boot.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-name: Boots
-command: ls
-timeout: 100
-stdout_destination: "/tmp/a"
diff --git a/tests/data/which-out.yaml b/tests/data/which-out.yaml
new file mode 100644
index 0000000..e29d0d8
--- /dev/null
+++ b/tests/data/which-out.yaml
@@ -0,0 +1,3 @@
+name: Which job
+command: /bin/which bash
+stdout_destination: /tmp/which-out.log
diff --git a/tests/test_job_wrapper.py b/tests/test_job_wrapper.py
index cea8ef6..bd020d9 100644
--- a/tests/test_job_wrapper.py
+++ b/tests/test_job_wrapper.py
@@ -55,3 +55,20 @@
             "grep: Invalid regular expression\n\n"
             "Job Bad grep job failed with code 2\n"
         )
+
+
+def test_store_output():
+    path = "/tmp/which-out.log"
+
+    if os.path.exists(path):
+        os.unlink(path)
+
+    run_job("which-out.yaml")
+
+    contents = open(path, "r").read()
+    lines = contents.split("\n")
+
+    assert len(lines) == 6
+    assert lines[4] == "/bin/bash"
+
+    os.unlink(path)

-- 
To view, visit https://gerrit.wikimedia.org/r/342971
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80fc8f0abf20ec0d0f971f4da3762e4f7a41b448
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/process-control
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to