瀏覽代碼

simple test for command line

Guénaël Muller 7 年之前
父節點
當前提交
4fa52aa366
共有 2 個文件被更改,包括 21 次插入0 次删除
  1. 0 0
      tracim/tests/commands/__init__.py
  2. 21 0
      tracim/tests/commands/commands.py

+ 0 - 0
tracim/tests/commands/__init__.py 查看文件


+ 21 - 0
tracim/tests/commands/commands.py 查看文件

@@ -0,0 +1,21 @@
1
+# -*- coding: utf-8 -*-
2
+import os
3
+import subprocess
4
+
5
+import tracim
6
+
7
+
8
+class TestCommands(object):
9
+    def test_commands(self):
10
+        """
11
+        Test listing of tracimcli command: Tracim commands must be listed
12
+        :return:
13
+        """
14
+        os.chdir(os.path.dirname(tracim.__file__) + '/../')
15
+
16
+        output = subprocess.check_output(["tracimcli", "-h"])
17
+        output = output.decode('utf-8')
18
+
19
+        assert output.find('user create') > 0
20
+        assert output.find('user update') > 0
21
+        assert output.find('db init') > 0