Quellcode durchsuchen

changed travis configuration to get py.test to work

pull/147/head
Johannes vor 8 Jahren
Ursprung
Commit
82d685d13c
3 geänderte Dateien mit 18 neuen und 7 gelöschten Zeilen
  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 Datei anzeigen

@@ -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 Datei anzeigen


+ 13
- 0
tests/testlib/utils.py Datei anzeigen

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

Laden…
Abbrechen
Speichern