Skip to content

Commit

Permalink
Add unit tests around reading -insecure parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
yannh committed Sep 17, 2022
1 parent 385fb7c commit e3c2363
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestFromFlags(t *testing.T) {
NWorkers: 10,
WithTTL: true,
Output: "resp",
Insecure: false,
},
},
{
Expand All @@ -34,6 +35,7 @@ func TestFromFlags(t *testing.T) {
NWorkers: 10,
WithTTL: true,
Output: "resp",
Insecure: false,
},
},
{
Expand All @@ -47,6 +49,7 @@ func TestFromFlags(t *testing.T) {
NWorkers: 10,
WithTTL: false,
Output: "resp",
Insecure: false,
},
},
{
Expand All @@ -60,10 +63,11 @@ func TestFromFlags(t *testing.T) {
NWorkers: 5,
WithTTL: true,
Output: "commands",
Insecure: false,
},
},
{
[]string{"-host", "redis", "-port", "1234", "-batchSize", "10", "-user", "test"},
[]string{"-host", "redis", "-port", "1234", "-batchSize", "10", "-user", "test", "-insecure"},
Config{
Db: -1,
Host: "redis",
Expand All @@ -74,6 +78,7 @@ func TestFromFlags(t *testing.T) {
WithTTL: true,
Output: "resp",
Username: "test",
Insecure: true,
},
},
{
Expand All @@ -87,6 +92,7 @@ func TestFromFlags(t *testing.T) {
NWorkers: 10,
WithTTL: true,
Output: "resp",
Insecure: false,
},
},
{
Expand All @@ -101,6 +107,7 @@ func TestFromFlags(t *testing.T) {
WithTTL: true,
Output: "resp",
Help: true,
Insecure: false,
},
},
}
Expand Down

0 comments on commit e3c2363

Please sign in to comment.