| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | |||
| 3 | """__init__ unit tests.""" |
||
| 4 | |||
| 5 | import pytest |
||
| 6 | import os |
||
| 7 | from flask import Flask |
||
| 8 | from loglan_db import app_lod, run_with_context |
||
| 9 | |||
| 10 | |||
| 11 | @pytest.mark.usefixtures("db") |
||
| 12 | def test_run_with_context(): |
||
| 13 | |||
| 14 | @run_with_context |
||
| 15 | def run_test(): |
||
| 16 | pass |
||
| 17 | |||
| 18 | result = run_test() |
||
| 19 | assert result is None |
||
| 20 | |||
| 21 | |||
| 22 | def test_app_lod(): |
||
| 23 | assert isinstance(app_lod(), Flask) |
||
| 24 | |||
| 25 | |||
| 26 | def test_run_with_context_no_uri(): |
||
| 27 | os.environ['LOD_DATABASE_URL'] = "None" |
||
| 28 | |||
| 29 | @run_with_context |
||
| 30 | def run_test(): |
||
| 31 | pass |
||
| 32 | |||
| 33 | result = run_test() |
||
| 34 | assert result is None |
||
| 35 |