repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

commit
d4c5a28
parent
e256c1c
author
Antonio Mika
date
2025-02-26 16:12:43 -0500 EST
Fix api test with memory db
1 files changed,  +19, -19
M pgs/web_test.go
+19, -19
  1@@ -63,7 +63,7 @@ func TestApiBasic(t *testing.T) {
  2 
  3 			storage: map[string]map[string]string{
  4 				bucketName: {
  5-					"test/index.html": "hello world!",
  6+					"/test/index.html": "hello world!",
  7 				},
  8 			},
  9 		},
 10@@ -76,7 +76,7 @@ func TestApiBasic(t *testing.T) {
 11 
 12 			storage: map[string]map[string]string{
 13 				bucketName: {
 14-					"test/test.html": "hello world!",
 15+					"/test/test.html": "hello world!",
 16 				},
 17 			},
 18 		},
 19@@ -89,7 +89,7 @@ func TestApiBasic(t *testing.T) {
 20 
 21 			storage: map[string]map[string]string{
 22 				bucketName: {
 23-					"test/subdir/index.html": "hello world!",
 24+					"/test/subdir/index.html": "hello world!",
 25 				},
 26 			},
 27 		},
 28@@ -102,8 +102,8 @@ func TestApiBasic(t *testing.T) {
 29 
 30 			storage: map[string]map[string]string{
 31 				bucketName: {
 32-					"test/_redirects": "/anything /about.html 301",
 33-					"test/about.html": "hello world!",
 34+					"/test/_redirects": "/anything /about.html 301",
 35+					"/test/about.html": "hello world!",
 36 				},
 37 			},
 38 		},
 39@@ -116,7 +116,7 @@ func TestApiBasic(t *testing.T) {
 40 
 41 			storage: map[string]map[string]string{
 42 				bucketName: {
 43-					"test/subdir/index.html": "hello world!",
 44+					"/test/subdir/index.html": "hello world!",
 45 				},
 46 			},
 47 		},
 48@@ -129,8 +129,8 @@ func TestApiBasic(t *testing.T) {
 49 
 50 			storage: map[string]map[string]string{
 51 				bucketName: {
 52-					"test/_redirects": "/* /index.html 200",
 53-					"test/index.html": "hello world!",
 54+					"/test/_redirects": "/* /index.html 200",
 55+					"/test/index.html": "hello world!",
 56 				},
 57 			},
 58 		},
 59@@ -154,7 +154,7 @@ func TestApiBasic(t *testing.T) {
 60 
 61 			storage: map[string]map[string]string{
 62 				bucketName: {
 63-					"test/404.html": "boom!",
 64+					"/test/404.html": "boom!",
 65 				},
 66 			},
 67 		},
 68@@ -167,7 +167,7 @@ func TestApiBasic(t *testing.T) {
 69 
 70 			storage: map[string]map[string]string{
 71 				bucketName: {
 72-					"test/profile.jpg": "image",
 73+					"/test/profile.jpg": "image",
 74 				},
 75 			},
 76 		},
 77@@ -181,8 +181,8 @@ func TestApiBasic(t *testing.T) {
 78 
 79 			storage: map[string]map[string]string{
 80 				bucketName: {
 81-					"test/_redirects": "/anything /about.html 301",
 82-					"test/about.html": "hello world!",
 83+					"/test/_redirects": "/anything /about.html 301",
 84+					"/test/about.html": "hello world!",
 85 				},
 86 			},
 87 		},
 88@@ -198,7 +198,7 @@ func TestApiBasic(t *testing.T) {
 89 
 90 			storage: map[string]map[string]string{
 91 				bucketName: {
 92-					"test/test.html": "hello world!",
 93+					"/test/test.html": "hello world!",
 94 				},
 95 			},
 96 		},
 97@@ -214,7 +214,7 @@ func TestApiBasic(t *testing.T) {
 98 
 99 			storage: map[string]map[string]string{
100 				bucketName: {
101-					"test/test.html": "hello world!",
102+					"/test/test.html": "hello world!",
103 				},
104 			},
105 		},
106@@ -230,7 +230,7 @@ func TestApiBasic(t *testing.T) {
107 
108 			storage: map[string]map[string]string{
109 				bucketName: {
110-					"test/test.html": "hello world!",
111+					"/test/test.html": "hello world!",
112 				},
113 			},
114 		},
115@@ -246,7 +246,7 @@ func TestApiBasic(t *testing.T) {
116 
117 			storage: map[string]map[string]string{
118 				bucketName: {
119-					"test/test.html": "hello world!",
120+					"/test/test.html": "hello world!",
121 				},
122 			},
123 		},
124@@ -264,7 +264,7 @@ func TestApiBasic(t *testing.T) {
125 
126 			storage: map[string]map[string]string{
127 				bucketName: {
128-					"test/test.html": "hello world!",
129+					"/test/test.html": "hello world!",
130 				},
131 			},
132 		},
133@@ -346,7 +346,7 @@ func TestImageManipulation(t *testing.T) {
134 
135 			storage: map[string]map[string]string{
136 				bucketName: {
137-					"test/app.jpg": "hello world!",
138+					"/test/app.jpg": "hello world!",
139 				},
140 			},
141 		},
142@@ -359,7 +359,7 @@ func TestImageManipulation(t *testing.T) {
143 
144 			storage: map[string]map[string]string{
145 				bucketName: {
146-					"test/subdir/app.jpg": "hello world!",
147+					"/test/subdir/app.jpg": "hello world!",
148 				},
149 			},
150 		},