Test Failed
Push — main ( 3c00a2...7c8c49 )
by torrua
02:08
created

tests.test_init   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 3
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