2022-02-18 12:40:07 -06:00
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
import updater
|
|
|
|
from unittest import mock
|
|
|
|
|
2022-02-19 14:14:53 -06:00
|
|
|
@pytest.mark.parametrize("system", [("Windows"), ("Linux"), ("Darwin")])
|
2022-02-18 12:40:07 -06:00
|
|
|
def test_find_datafiles(system):
|
|
|
|
with mock.patch("platform.system", return_value=system):
|
|
|
|
result = updater.find_datafiles()
|
2022-02-19 14:14:53 -06:00
|
|
|
if system == "Windows":
|
|
|
|
assert "bootstrap.exe" in result[0][1][0]
|
|
|
|
assert os.path.exists(result[0][1][0])
|
|
|
|
else:
|
|
|
|
assert len(result[0][1]) == 2
|
|
|
|
assert os.path.exists(result[0][1][0])
|
|
|
|
assert os.path.exists(result[0][1][1])
|