Download:
child 71:6e9d9e772cf5
parent 69:4ec316ee87e8
70:ff099617103f
Anton Shestakov <av6@dwimlabs.net>, Sun, 26 Jun 2016 14:21:43 +0800
tests: test run() from checker.py

1 файлов изменено, 21 вставок(+), 0 удалений(-) [+]
tests/test_checker.py file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_checker.py Sun Jun 26 14:21:43 2016 +0800
@@ -0,0 +1,21 @@
+from checker import run
+
+
+def test_run():
+ result = run(['true'])
+ assert result is True
+
+ result = run(['false'])
+ assert result is False
+
+ result = run(['false'], ignore_codes=(1,))
+ assert result is True
+
+ result = run(['false'], ignore_codes=(127,))
+ assert result is False
+
+ result = run(['echo', 'hi'], get_output=False)
+ assert result is True
+
+ result = run(['echo', 'hi'], get_output=True)
+ assert result == 'hi\n'