mvo5 / unattended-upgrades

Automatic installation of security upgrades on apt based systems
GNU General Public License v2.0
278 stars 78 forks source link

test: add `TestBase.mock_distro` and use in tests #326

Closed mvo5 closed 2 years ago

mvo5 commented 2 years ago

Instead of monkey patching unattended_upgrade.DISTOR_* this commit adds a proper TestBase.mock_distro() helper that uses unittest.mock.patch() and restores the state after the test again properly.