New test cases added
This commit is contained in:
@@ -70,6 +70,11 @@ func TestNew(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedError: "",
|
expectedError: "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Empty config",
|
||||||
|
config: nil,
|
||||||
|
expectedError: "config cannot be nil",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Empty routing config path",
|
name: "Empty routing config path",
|
||||||
config: &Config{
|
config: &Config{
|
||||||
@@ -77,6 +82,13 @@ func TestNew(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedError: "routing_config path is empty",
|
expectedError: "routing_config path is empty",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Routing config file does not exist",
|
||||||
|
config: &Config{
|
||||||
|
RoutingConfig: "/nonexistent/path/to/rules.yaml",
|
||||||
|
},
|
||||||
|
expectedError: "error reading config file",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user