Skip to content

Commit

Permalink
Add first tests
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Jun 1, 2018
1 parent de55262 commit 57f4cab
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions tests/web_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@

import application
import pathlib
import tempfile
import pytest


@pytest.mark.skip("Tests require updating")
class TestWebApplication:
def setup_method(self):
"""
Creating a Flask app, and a bokeh resources path for each method of
the class.
Creating a Flask app and temporary folders.
"""
self.app, self.bokeh_resources = application.config.create_app()


def test_config(self):
self.app, self.dumpdir, self.archivedir = application.config.create_app()

def test_temporary_folders(self):
"""
Tests if temporary folders are set up correctly.
"""
tempdir = tempfile.gettempdir()
correct_dumpdir = str(pathlib.Path(tempdir, "topicsexplorerdump"))
correct_archivedir = str(pathlib.Path(tempdir, "topicsexplorerdata"))

assert self.dumpdir == correct_dumpdir
assert self.archivedir == correct_archivedir

def test_configs(self):
"""
Tests if the config loads correctly.
"""
Expand All @@ -24,10 +33,4 @@ def test_config(self):
assert self.app.config['DEBUG'] == False
assert self.app.import_name == 'application.config'
assert self.app.template_folder == 'templates'
assert self.app.static_folder == str(pathlib.Path(cwd, 'application', 'static'))
assert self.bokeh_resources == str(pathlib.Path('application', 'static', 'bokeh_templates'))


def test_index(self):
return None

assert self.app.static_folder == str(pathlib.Path(cwd, 'application', 'static'))

0 comments on commit 57f4cab

Please sign in to comment.