From 5b8189a0152c47f8ac6529f7511431428245e8d5 Mon Sep 17 00:00:00 2001 From: Marek Ventur Date: Thu, 23 Aug 2018 23:07:25 +0100 Subject: [PATCH] Bootstrap 'app' --- badge_store/icon.gif | Bin 2104 -> 0 bytes badge_store/main.py | 7 +++++-- bootstrap/main.py | 26 ++++++++++++++++++++++++++ lib/badge_store.py | 36 +++++++++++++++--------------------- lib/test_badge_store.py | 8 +++++++- 5 files changed, 53 insertions(+), 24 deletions(-) delete mode 100644 badge_store/icon.gif create mode 100644 bootstrap/main.py diff --git a/badge_store/icon.gif b/badge_store/icon.gif deleted file mode 100644 index 459f81c6a5df0c967a1f593fe0bb5f4d586720b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2104 zcmchW>pv3;1Av!H3Co)~V?huS|rsT5uMa9?k&x+Nhl`o=k$*6eD zIJww3iD49%3wf9YiG5*kk75u>2Hz!s|4cSXtASIh;Hgz`awUvZ1|ycj2qngeMaIwQ z(1cgegaT-MzR{y>NDLJclW7>8ZWxtjct6!3BE=w_1P)8ozmuSki#JKDhLbDcDHU*1 zIqaX-Q=0M9LMT2D`Xm?fAOjMeVGvFP|M3hQ`cxl_*T+7AM5UP!OAw?oL?R7(H`zR; z3=x-Y_O!r~z_3W7S&_?;X|Jt_#bysP5%)+IkEzEqDy<20+mzxH&+;5oOHXH1xa8EI zNufKF3f*(+Tr$egl%h+8jUHs04}}(xR~wjF9PpgspHBCq6a-`x`KQrvuiHZMt8t}G zIC?#{ur{ip=TQ?2-^{|l?TuvA;Tt+h?HtN`R#w+=MoVv8QB@w3M;j2n>Jt<)xp}S3 zoaU}N!DLwiwzMMq^x2c}vW&$q>SQ(bv)eg*!OT2&LdqMH%&#aG zmX_c4vwH%q5N;Wbn6--R=C6galzRWEwjEY2kEY|wBZ;I8`t*xyeKYna%Y^<%V zt*oppFE1}GEiEoC&d<-!&d$o^^6BYmsZ=^KF)=CY+5H@Lp2~e0z(@if z_Vl4Shs$^G)A!1q?Wd#nbY?0C9dbd01fi2baNoZO7md%QL0q4Y)Q2SRrz-i?c$F*W zx?%fo2eX^%<$We6J-^>ugQ?;(&uaa0OALbYi*@ge-y5v*x2JsfQ3mh3v0Dy&nOZ-D!bwd5!rih?wCjax4GqIzNxWXhl`Xa}xcP+=JOQ-{@imJ#@^+soT1tyYo&94kPs$V@WIMVQ*s}Q8u8RegJCv1&C+~}pA0vL_n`oYMol4fT8{F-6rE>PkhGJS- zeT#9PnI-<^8UdndrbmrnBfG`V)%F;{A_>=@dz(zg{d6_T4g#rSM0-tdbb3Uu0-v&p zEChpXh%1@Ti~D&-o2ivsVR|DN5@FM)27g8HA`M*N7bVVBcNprRwiVr;d6NiX@M9zf zN-~R+sp4F=f4@n#-UjsCId6m_83$vs54sb*HW{QhwD?;-jnW}+T|HQzZw9pZ&22zQgBeIwJ(4Y)Pf@nF z6$$>6;x1cKcXWqZAhoJuLp8*f^*wr(uxPSH$g>lp>4CwA33YrJO_FJF=X(w!!VfQc6U5ES^PlKO5crh#RWf0<7-tqoXX!Czu% zXUxidtSM%{!&>V=nhvdp_8s){T144dGa{`yc3;`nT#ErrrvQLX9z<#!bBPL3-BML^ zQX+muIczLjbI+EY0@@})fNyksM^qLu-p&z`9Jb<-txypL)YOxHuuu{EzQk7gs8uza zkK=ZB^zR8>E-7mw?<4YU#7CRB>!lZuKy0Ose-|_g6Z|g?fxmT~Qkgm03P8w*ENL?% ze%Hb46;$Pr7~2P}t<5^bcA0%(@oG=U)a5d;y#&3dre#hjquVbuv^&3Vaja9Xt2^+R4aJ^x-1$SzYXdJ}82(W*jQYN?$LJVNt@sWIA~NChL#czEj1QUkv&X?GD9p z2?hTx)>h%W2Sil_RG}tBH?jw==JGNNtGb-O+YMaL<=+=Ff_1}L9 5: try: os.remove(TEMP_FILE) @@ -78,7 +73,6 @@ class Installer: pass raise OSError("Aborting download of %s after 5 unsuccessful attempts" % self.path) try: - print("download ", self.url, self.params) get(self.url, params=self.params).raise_for_status().download_to(TEMP_FILE) except OSError as e: if "404" in str(e): diff --git a/lib/test_badge_store.py b/lib/test_badge_store.py index cdfb6b6..e1e7e67 100644 --- a/lib/test_badge_store.py +++ b/lib/test_badge_store.py @@ -39,13 +39,19 @@ class TestBadgeStore(unittest.TestCase): def test_install_integration(self): self._remove_download_file() store = BadgeStore(url="http://badge.marekventur.com", repo="emfcamp/Mk4-Apps", ref="dont-delete-test-download-branch") - for installer in store.call_install(["launcher"]): + for installer in store.install(["launcher"]): if installer.path == "shared/test/download.txt": installer.download() with open(self.download_file, "rt") as response: self.assertIn("I'm a download test", response.read()) + def test_bootstrap_integration(self): + self._remove_download_file() + store = BadgeStore(url="http://badge.marekventur.com") + installers = store.bootstrap() + self.assertTrue(len(installers) > 0) + def _remove_download_file(self): if isdir(self.download_file) or isfile(self.download_file): os.remove(self.download_file)