[tests] black -t py34
This commit is contained in:
parent
e9e67ae375
commit
79fb28512f
10 changed files with 144 additions and 39 deletions
|
@ -2,22 +2,27 @@ import pytest
|
|||
|
||||
from util.algorithm import *
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def someData():
|
||||
return {"a": 100, "b": 200, "c": [1, 2, 3]}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def differentData():
|
||||
return {"x": 20, "y": "bla", "z": ["a", "b"]}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def moreData():
|
||||
return {"n": 100}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def overlapData():
|
||||
return {"a": 200, "c": [1, 2, 4]}
|
||||
|
||||
|
||||
def test_merge_with_empty(someData):
|
||||
assert merge(someData, {}) == someData
|
||||
assert merge(someData, None) == None
|
||||
|
|
|
@ -2,24 +2,30 @@ import pytest
|
|||
|
||||
import util.cli
|
||||
|
||||
|
||||
def test_valid_command():
|
||||
assert util.cli.execute("echo test") == "test\n"
|
||||
|
||||
|
||||
def test_utf_command():
|
||||
rv = util.cli.execute("echo ÖPmŧß")
|
||||
assert util.cli.execute("echo ÖPmŧß") == "ÖPmŧß\n"
|
||||
|
||||
|
||||
def test_invalid_command():
|
||||
with pytest.raises(RuntimeError):
|
||||
util.cli.execute("i-do-not-exist")
|
||||
|
||||
|
||||
def test_command_exit_code():
|
||||
with pytest.raises(RuntimeError):
|
||||
util.cli.execute("cat i-do-not-exist")
|
||||
|
||||
|
||||
def test_command_exit_code_no_error():
|
||||
util.cli.execute("cat i-do-not-exist", ignore_errors=True)
|
||||
|
||||
|
||||
def test_async():
|
||||
assert util.cli.execute("echo test", wait=False) == ""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue