mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Error check.
This commit is contained in:
parent
54e2c6181a
commit
409f76aa34
@ -703,6 +703,8 @@ update_package_cache() {
|
|||||||
echo -n "::: Updating local cache of available packages..."
|
echo -n "::: Updating local cache of available packages..."
|
||||||
if eval ${UPDATE_PKG_CACHE}; then
|
if eval ${UPDATE_PKG_CACHE}; then
|
||||||
echo " done!"
|
echo " done!"
|
||||||
|
else
|
||||||
|
echo -n "\n!!! ERROR - Unable to update package cache. Please try \"${UPDATE_PKG_CACHE}\""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,14 +285,15 @@ def test_update_package_cache_success_no_errors(Pihole):
|
|||||||
assert 'done!' in updateCache.stdout
|
assert 'done!' in updateCache.stdout
|
||||||
|
|
||||||
def test_update_package_cache_failure_no_errors(Pihole):
|
def test_update_package_cache_failure_no_errors(Pihole):
|
||||||
''' confirms package cache was updated without any errors'''
|
''' confirms package cache was not updated'''
|
||||||
mock_command('apt-get', {'*':('', '1')}, Pihole)
|
mock_command('apt-get', {'update':('', '1')}, Pihole)
|
||||||
updateCache = Pihole.run('''
|
updateCache = Pihole.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
distro_check
|
distro_check
|
||||||
update_package_cache
|
update_package_cache
|
||||||
''')
|
''')
|
||||||
assert 'Updating local cache of available packages...' in updateCache.stdout
|
assert 'Updating local cache of available packages...' in updateCache.stdout
|
||||||
|
assert 'ERROR' in updateCache.stdout
|
||||||
assert 'done!' not in updateCache.stdout
|
assert 'done!' not in updateCache.stdout
|
||||||
|
|
||||||
# Helper functions
|
# Helper functions
|
||||||
|
Loading…
Reference in New Issue
Block a user