Fixed stuff
This commit is contained in:
parent
4635eea99d
commit
d53676c689
@ -91,7 +91,7 @@ def test_extract_archive():
|
|||||||
with mock.patch("zipfile.ZipFile", return_value=zipfile_opened) as zipfile_mock:
|
with mock.patch("zipfile.ZipFile", return_value=zipfile_opened) as zipfile_mock:
|
||||||
result = updater.extract_update("update.zip", os.path.dirname(__file__))
|
result = updater.extract_update("update.zip", os.path.dirname(__file__))
|
||||||
assert result == os.path.dirname(__file__)
|
assert result == os.path.dirname(__file__)
|
||||||
zipfile_mock.called_once_with("update.zip")
|
zipfile_mock.assert_called_once_with("update.zip")
|
||||||
zipfile_opened.extractall.assert_called_once()
|
zipfile_opened.extractall.assert_called_once()
|
||||||
# Test a password protected update file.
|
# Test a password protected update file.
|
||||||
zipfile_opened_with_password = mock.MagicMock()
|
zipfile_opened_with_password = mock.MagicMock()
|
||||||
@ -100,8 +100,8 @@ def test_extract_archive():
|
|||||||
updater.password = "MyLongPassword"
|
updater.password = "MyLongPassword"
|
||||||
result2 = updater.extract_update("update.zip", os.path.dirname(__file__))
|
result2 = updater.extract_update("update.zip", os.path.dirname(__file__))
|
||||||
assert result2 == os.path.dirname(__file__)
|
assert result2 == os.path.dirname(__file__)
|
||||||
zipfile_mock.called_once_with("update.zip")
|
zipfile_mock.assert_called_once_with("update.zip")
|
||||||
zipfile_opened_with_password.setpassword.called_once_with("MyLongPassword")
|
zipfile_opened_with_password.setpassword.assert_called_once_with("MyLongPassword")
|
||||||
zipfile_opened_with_password.extractall.assert_called_once()
|
zipfile_opened_with_password.extractall.assert_called_once()
|
||||||
|
|
||||||
@pytest.mark.parametrize("system", [("Windows"), ("Darwin"), ("Linux")])
|
@pytest.mark.parametrize("system", [("Windows"), ("Darwin"), ("Linux")])
|
||||||
|
Loading…
Reference in New Issue
Block a user