浏览代码

changed travis configuration to get py.test to work

pull/147/head
Johannes 8 年前
父节点
当前提交
82d685d13c
共有 3 个文件被更改,包括 18 次插入7 次删除
  1. +5
    -7
      tests/logs/test_log_view.py
  2. +0
    -0
      tests/testlib/__init__.py
  3. +13
    -0
      tests/testlib/utils.py

+ 5
- 7
tests/logs/test_log_view.py 查看文件

@@ -1,15 +1,13 @@

from modules.logs import LogView
from tests.testlib import utils


class TestLogView(object):

def test_get_all_logfiles(self):
LogView._log_directory = utils.get_base_path() + "/logs"

LogView._log_directory = "./logs"

log_view = LogView()
logfiles = log_view.get_all_logfiles()
logfiles = LogView().get_all_logfiles()

print(logfiles)
assert (len(logfiles) == 2)
# if no log file is found then two square brackets "[]" are returned and string length is 2
assert (len(logfiles) > 2)

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


+ 13
- 0
tests/testlib/utils.py 查看文件

@@ -0,0 +1,13 @@
import os


def get_base_path():
marker_file = "run.py"

current_path = os.getcwd()

while current_path != 0:
if marker_file in os.listdir(current_path):
return current_path

current_path = os.path.dirname(os.path.normpath(current_path))

正在加载...
取消
保存