Increased coverage of test module
This commit is contained in:
parent
dcdb3250e4
commit
14324e56fe
@ -3,14 +3,14 @@ import pytest
|
|||||||
import updater
|
import updater
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
@pytest.mark.parametrize("system", [("Windows", "Linux", "Darwin")])
|
@pytest.mark.parametrize("system", [("Windows"), ("Linux"), ("Darwin")])
|
||||||
def test_find_datafiles(system):
|
def test_find_datafiles(system):
|
||||||
with mock.patch("platform.system", return_value=system):
|
with mock.patch("platform.system", return_value=system):
|
||||||
result = updater.find_datafiles()
|
result = updater.find_datafiles()
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
assert "bootstrap.exe" in result[0][1]
|
assert "bootstrap.exe" in result[0][1][0]
|
||||||
assert os.path.exists(result[0][1][0])
|
assert os.path.exists(result[0][1][0])
|
||||||
else:
|
else:
|
||||||
assert len(result[0][1]) == 2
|
assert len(result[0][1]) == 2
|
||||||
assert os.path.exists(result[0][1][0])
|
assert os.path.exists(result[0][1][0])
|
||||||
assert os.path.exists(result[0][1][1])
|
assert os.path.exists(result[0][1][1])
|
Loading…
Reference in New Issue
Block a user