Passed
Pull Request — dev (#1208)
by Patrik
04:04 queued 02:13
created

tests.test_console_scripts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A test_console_scripts() 0 3 1
A test_solver_check() 0 7 1
1
# -*- coding: utf-8 -
2
3
"""Tests the console_test module, without the test_oemof function.
4
5
This file is part of project oemof (github.com/oemof/oemof). It's copyrighted
6
by the contributors recorded in the version control history of the file,
7
available from its original location oemof/tests/test_processing.py
8
9
SPDX-License-Identifier: MIT
10
"""
11
from oemof.solph import _console_scripts as console_scripts
12
13
14
def test_console_scripts():
15
    # this is just a smoke test
16
    console_scripts.check_oemof_installation()
17
18
19
def test_solver_check():
20
    solver_list = ["cbc", "invalid solver"]
21
    results = console_scripts._check_oemof_installation(solver_list)
22
23
    assert isinstance(results, dict)
24
    assert list(results.keys()) == solver_list
25
    assert not results["invalid solver"]
26