From 16026b29c49bb24b6705108994929c5a83fd1f92 Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Sat, 6 Apr 2024 15:31:58 -0700 Subject: [PATCH] Add error-handling to Set Pref and Clear Cache actions --- YouVersion Suggest (Alfred 5).alfredworkflow | Bin 126544 -> 127124 bytes tests/test_clear_cache.py | 7 +++++-- tests/test_set_pref.py | 4 +++- yvs/clear_cache.py | 3 +++ yvs/set_pref.py | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/YouVersion Suggest (Alfred 5).alfredworkflow b/YouVersion Suggest (Alfred 5).alfredworkflow index 121b339f98a537e5757ce939093150d60511d083..b20d55f12fa69a7654bbb072071e0cf33c8c124f 100644 GIT binary patch delta 7753 zcmZ9R1yEGczsGl%?rvELB@__Jr9(nQLZov^LAskugS6Dr-7O#`NasqIbO}gzDE08q zd-LYKJ9F>c&-eE|zd85JId{%)&d5AQ{0c@D*EMkM8LYWV>0d!k2?7-yfk4%EHlUPjAbSrr-Il`Sv;C)1_6WtF-;a*!5G3Zy!lYUA|TvGm~NBOH0xD!qF$V zzT90jLk~CXCSF0F&}Dm(vJM?>q_?^{UCfEyy6{n@A;Lcjr{1pM3AEXwuRHMwL6yXA zR)E3E#|$dAx0m~_ws+lklirtCSDZ;oJ!&FuccnL5FKiCcX`v~9yi}mjzXU#qw}q|O z$A+L`m@w|$nc3k+ZN;V-6zcQmcpaWpAxJqmG!`_ua@B36&#@hzxon7O1A|pWFSS{! zE49ADzuq}=Q*FIkAg~ofP#i=hj<3lH0HQvgNj?EU**4n9Uwo)HC$-{0?y(oF9G}As zi7Zq_DrF9o_;|XxudF-DbT(b{=;+P^Lm@L(Dk2STeCdg~f+Bl=|H|j6QxI;asU$L% zHjC>@g+)YQ3q+EIzguG{DHQ_Tgml@02bK7h8oh>IDhp=dkEbT`FD2c2$i;*L5kf|| zIn{@uB*QTYigc@Gi51G9bLyB8Lpw(Bq-a&W}}tkKC?5Umbz z6jr>~R6+0Hf#wDIV>y~Q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-A8%<4BRWoeUw*VvM2A|w9}}(&jAR6<%&c-qtX5!RzjOl diff --git a/tests/test_clear_cache.py b/tests/test_clear_cache.py index edf086f..570cc3e 100644 --- a/tests/test_clear_cache.py +++ b/tests/test_clear_cache.py @@ -7,11 +7,13 @@ import yvs.clear_cache as yvs from tests import YVSTestCase +from tests.decorators import redirect_stdout class TestClearCachw(YVSTestCase): - def test_clear_cache(self): + @redirect_stdout + def test_clear_cache(self, out): """should remove cache directory when cache is cleared""" yvs.main() self.assertFalse( @@ -19,7 +21,8 @@ def test_clear_cache(self): "local cache directory exists", ) - def test_clear_cache_silent_fail(self): + @redirect_stdout + def test_clear_cache_silent_fail(self, out): """should fail silently if cache directory does not exist""" shutil.rmtree(yvs.cache.LOCAL_CACHE_DIR_PATH) yvs.main() diff --git a/tests/test_set_pref.py b/tests/test_set_pref.py index 974195f..6ef75b9 100644 --- a/tests/test_set_pref.py +++ b/tests/test_set_pref.py @@ -56,6 +56,8 @@ def test_main(self, out): } yvs.main(alfred_variables) alfred_json = json.loads(out.getvalue()) - self.assertEqual(alfred_json["alfredworkflow"]["variables"], alfred_variables) + self.assertEqual( + alfred_json["alfredworkflow"]["variables"], {"did_set_pref": "True"} + ) user_prefs = yvs.core.get_user_prefs() self.assertEqual(user_prefs["version"], 107) diff --git a/yvs/clear_cache.py b/yvs/clear_cache.py index 16ebb27..5880d64 100644 --- a/yvs/clear_cache.py +++ b/yvs/clear_cache.py @@ -1,12 +1,15 @@ #!/usr/bin/env python3 # coding=utf-8 +import json + import yvs.cache as cache def main(): cache.clear_cache() + print(json.dumps({"alfredworkflow": {"variables": {"did_clear_cache": "True"}}})) if __name__ == "__main__": diff --git a/yvs/set_pref.py b/yvs/set_pref.py index 14fc759..415f97e 100644 --- a/yvs/set_pref.py +++ b/yvs/set_pref.py @@ -28,7 +28,7 @@ def main(variables): # value_id needs to be parsed as JSON so we can preserve type data for # proper serialization to the preferences file set_pref(variables["pref_id"], json.loads(variables["value_id"])) - print(json.dumps({"alfredworkflow": {"variables": variables}})) + print(json.dumps({"alfredworkflow": {"variables": {"did_set_pref": "True"}}})) if __name__ == "__main__":