mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Test for sql.go in ers
This commit is contained in:
committed by
Dan Christian Bogos
parent
65320aa4ff
commit
eaf245fb20
@@ -635,3 +635,27 @@ func TestSQLSetURLError(t *testing.T) {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSQLSetURLError2(t *testing.T) {
|
||||
cfg := config.NewDefaultCGRConfig()
|
||||
testSQLEventReader := &SQLEventReader{
|
||||
cgrCfg: cfg,
|
||||
cfgIdx: 0,
|
||||
fltrS: &engine.FilterS{},
|
||||
connString: "",
|
||||
connType: "",
|
||||
tableName: "testName",
|
||||
expConnString: "",
|
||||
expConnType: utils.Postgres,
|
||||
expTableName: "",
|
||||
rdrEvents: nil,
|
||||
rdrExit: nil,
|
||||
rdrErr: nil,
|
||||
cap: nil,
|
||||
}
|
||||
err := testSQLEventReader.setURL("*mysql://cgrates:CGRateS.org@127.0.0.1:3306", "http://user^:passwo^rd@foo.com/", nil)
|
||||
expected := `parse "http://user^:passwo^rd@foo.com/": net/url: invalid userinfo`
|
||||
if err == nil || err.Error() != expected {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user