This commit is contained in:
Quentin McGaw
2020-03-30 12:01:35 +00:00
parent f251c6aa4d
commit bfa3d749ac

View File

@@ -23,7 +23,7 @@ func Test_generateConf(t *testing.T) {
lines: []string{ lines: []string{
"DefaultErrorFile \"/usr/share/tinyproxy/default.html\"", "DefaultErrorFile \"/usr/share/tinyproxy/default.html\"",
"DisableViaHeader Yes", "DisableViaHeader Yes",
"Group tinyproxy", "Group 1001",
"LogLevel Info", "LogLevel Info",
"MaxClients 100", "MaxClients 100",
"MaxRequestsPerChild 0", "MaxRequestsPerChild 0",
@@ -32,7 +32,7 @@ func Test_generateConf(t *testing.T) {
"Port 2000", "Port 2000",
"StartServers 10", "StartServers 10",
"Timeout 600", "Timeout 600",
"User nonrootuser", "User 1000",
}, },
}, },
"With credentials": { "With credentials": {
@@ -44,7 +44,7 @@ func Test_generateConf(t *testing.T) {
"BasicAuth abc def", "BasicAuth abc def",
"DefaultErrorFile \"/usr/share/tinyproxy/default.html\"", "DefaultErrorFile \"/usr/share/tinyproxy/default.html\"",
"DisableViaHeader Yes", "DisableViaHeader Yes",
"Group tinyproxy", "Group 1001",
"LogLevel Error", "LogLevel Error",
"MaxClients 100", "MaxClients 100",
"MaxRequestsPerChild 0", "MaxRequestsPerChild 0",
@@ -53,7 +53,7 @@ func Test_generateConf(t *testing.T) {
"Port 2000", "Port 2000",
"StartServers 10", "StartServers 10",
"Timeout 600", "Timeout 600",
"User nonrootuser", "User 1000",
}, },
}, },
} }
@@ -61,7 +61,7 @@ func Test_generateConf(t *testing.T) {
tc := tc tc := tc
t.Run(name, func(t *testing.T) { t.Run(name, func(t *testing.T) {
t.Parallel() t.Parallel()
lines := generateConf(tc.logLevel, tc.port, tc.user, tc.password) lines := generateConf(tc.logLevel, tc.port, tc.user, tc.password, 1000, 1001)
assert.Equal(t, tc.lines, lines) assert.Equal(t, tc.lines, lines)
}) })
} }