@@ -29,7 +29,7 @@ def setUp(self):
2929 contents = '''
3030 CONTAINER_VERSION: $container_version
3131 RUN apt -y install git
32- RUN git clone -b $ps_version https://github.com/PrestaShop/PrestaShop.git /tmp/data-ps
32+ RUN git clone -b $branch_version https://github.com/PrestaShop/PrestaShop.git /tmp/data-ps
3333 '''
3434 )
3535
@@ -46,10 +46,10 @@ def test_create_directory(self):
4646 self .assertTrue (path .exists ('/tmp/images/test' ))
4747
4848 def test_generate_image (self ):
49- dockerfile = '/tmp/images/1.7.8/7.4-alpine/Dockerfile'
49+ dockerfile = '/tmp/images/1.7.8.0 /7.4-alpine/Dockerfile'
5050 self .assertFalse (path .exists (dockerfile ))
5151 self .generator .generate_image (
52- '1.7.8' ,
52+ '1.7.8.0 ' ,
5353 '7.4-alpine'
5454 )
5555 self .assertTrue (path .exists (dockerfile ))
@@ -58,29 +58,67 @@ def test_generate_image(self):
5858 content = f .read ()
5959 self .assertIn (
6060 'PS_URL: https://www.prestashop.com/download/old/'
61- 'prestashop_1.7.8.zip' ,
61+ 'prestashop_1.7.8.0. zip' ,
6262 content
6363 )
64- self .assertIn ('PS_VERSION: 1.7.8' , content )
64+ self .assertIn ('PS_VERSION: 1.7.8.0' , content )
65+ self .assertIn ('CONTAINER_VERSION: 7.4-alpine' , content )
66+
67+ def test_generate_image_1788 (self ):
68+ dockerfile = '/tmp/images/1.7.8.8/7.4-alpine/Dockerfile'
69+ self .assertFalse (path .exists (dockerfile ))
70+ self .generator .generate_image (
71+ '1.7.8.8' ,
72+ '7.4-alpine'
73+ )
74+ self .assertTrue (path .exists (dockerfile ))
75+
76+ with open (dockerfile ) as f :
77+ content = f .read ()
78+ self .assertIn (
79+ 'PS_URL: https://www.prestashop.com/download/old/'
80+ 'prestashop_1.7.8.8.zip' ,
81+ content
82+ )
83+ self .assertIn ('PS_VERSION: 1.7.8.8' , content )
84+ self .assertIn ('CONTAINER_VERSION: 7.4-alpine' , content )
85+
86+ def test_generate_image_1789 (self ):
87+ dockerfile = '/tmp/images/1.7.8.9/7.4-alpine/Dockerfile'
88+ self .assertFalse (path .exists (dockerfile ))
89+ self .generator .generate_image (
90+ '1.7.8.9' ,
91+ '7.4-alpine'
92+ )
93+ self .assertTrue (path .exists (dockerfile ))
94+
95+ with open (dockerfile ) as f :
96+ content = f .read ()
97+ self .assertIn (
98+ 'PS_URL: https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.9/'
99+ 'prestashop_1.7.8.9.zip' ,
100+ content
101+ )
102+ self .assertIn ('PS_VERSION: 1.7.8.9' , content )
65103 self .assertIn ('CONTAINER_VERSION: 7.4-alpine' , content )
66104
67105 def test_generate_image_80 (self ):
68- dockerfile = '/tmp/images/8.0/7.4-alpine/Dockerfile'
106+ dockerfile = '/tmp/images/8.0.0 /7.4-alpine/Dockerfile'
69107 self .assertFalse (path .exists (dockerfile ))
70108 self .generator .generate_image (
71- '8.0' ,
109+ '8.0.0 ' ,
72110 '7.4-alpine'
73111 )
74112 self .assertTrue (path .exists (dockerfile ))
75113
76114 with open (dockerfile ) as f :
77115 content = f .read ()
78116 self .assertIn (
79- 'PS_URL: https://github.com/PrestaShop/PrestaShop/releases/download/8.0/'
80- 'prestashop_8.0.zip' ,
117+ 'PS_URL: https://github.com/PrestaShop/PrestaShop/releases/download/8.0.0 /'
118+ 'prestashop_8.0.0. zip' ,
81119 content
82120 )
83- self .assertIn ('PS_VERSION: 8.0' , content )
121+ self .assertIn ('PS_VERSION: 8.0.0 ' , content )
84122 self .assertIn ('CONTAINER_VERSION: 7.4-alpine' , content )
85123
86124 def test_generate_nightly_image (self ):
@@ -116,29 +154,42 @@ def test_generate_branch_image(self):
116154 'PS_URL' ,
117155 content
118156 )
119- self .assertNotIn ('PS_VERSION' , content )
120157 self .assertIn ('CONTAINER_VERSION: 8.1-alpine' , content )
121158 self .assertIn ('RUN apt -y install git' , content )
122159 self .assertIn ('RUN git clone -b 9.0.x https://github.com/PrestaShop/PrestaShop.git /tmp/data-ps' , content )
123160
124161 def test_generate_all (self ):
125162 files = (
126- '/tmp/images/7.0/7.3-apache/Dockerfile' ,
127- '/tmp/images/7.0/7.3-fpm/Dockerfile' ,
128- '/tmp/images/7.0/7.2-apache/Dockerfile' ,
129- '/tmp/images/7.0/7.2-fpm/Dockerfile' ,
130- '/tmp/images/8.0/7.1-apache/Dockerfile' ,
131- '/tmp/images/8.0/7.1-fpm/Dockerfile' ,
132- '/tmp/images/8.0/5.6-apache/Dockerfile' ,
133- '/tmp/images/8.0/5.6-fpm/Dockerfile' ,
163+ '/tmp/images/1.7.8.8/7.3-apache/Dockerfile' ,
164+ '/tmp/images/1.7.8.8/7.3-fpm/Dockerfile' ,
165+ '/tmp/images/1.7.8.8/7.2-apache/Dockerfile' ,
166+ '/tmp/images/1.7.8.8/7.2-fpm/Dockerfile' ,
167+ '/tmp/images/8.0.0/7.2-apache/Dockerfile' ,
168+ '/tmp/images/8.0.0/7.2-fpm/Dockerfile' ,
169+ '/tmp/images/8.0.0/8.1-apache/Dockerfile' ,
170+ '/tmp/images/8.0.0/8.1-fpm/Dockerfile' ,
171+ '/tmp/images/9.0.x/8.1-apache/Dockerfile' ,
172+ '/tmp/images/9.0.x/8.1-fpm/Dockerfile' ,
173+ '/tmp/images/9.0.x/8.2-apache/Dockerfile' ,
174+ '/tmp/images/9.0.x/8.2-fpm/Dockerfile' ,
175+ '/tmp/images/9.0.x/8.3-apache/Dockerfile' ,
176+ '/tmp/images/9.0.x/8.3-fpm/Dockerfile' ,
177+ '/tmp/images/nightly/8.1-apache/Dockerfile' ,
178+ '/tmp/images/nightly/8.1-fpm/Dockerfile' ,
179+ '/tmp/images/nightly/8.2-apache/Dockerfile' ,
180+ '/tmp/images/nightly/8.2-fpm/Dockerfile' ,
181+ '/tmp/images/nightly/8.3-apache/Dockerfile' ,
182+ '/tmp/images/nightly/8.3-fpm/Dockerfile' ,
134183 )
135184 for f in files :
136185 self .assertFalse (path .exists (f ))
137186
138187 self .generator .generate_all (
139188 {
140- '7.0' : ('7.2' , '7.3' ),
141- '8.0' : ('7.1' , '5.6' ),
189+ '1.7.8.8' : ('7.2' , '7.3' ),
190+ '8.0.0' : ('7.2' , '8.1' ),
191+ '9.0.x' : ('8.1' , '8.2' , '8.3' ),
192+ 'nightly' : ('8.1' , '8.2' , '8.3' ),
142193 }
143194 )
144195
0 commit comments