ソースを参照

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))

読み込み中…
キャンセル
保存