2026-04-12 15:47:48 +08:00
|
|
|
package neo4j
|
|
|
|
|
|
2026-04-13 14:36:54 +08:00
|
|
|
import (
|
2026-04-13 14:45:14 +08:00
|
|
|
"context"
|
2026-04-13 14:36:54 +08:00
|
|
|
"testing"
|
2026-04-12 15:47:48 +08:00
|
|
|
|
2026-04-15 15:19:39 +08:00
|
|
|
"knowledge-graph-backend/internal/config"
|
2026-04-13 14:36:54 +08:00
|
|
|
)
|
|
|
|
|
|
2026-04-13 14:45:14 +08:00
|
|
|
func TestNewDriver(t *testing.T) {
|
2026-04-13 14:36:54 +08:00
|
|
|
cnf, err := config.Load()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Errorf("[cnf]: %v", err)
|
|
|
|
|
}
|
|
|
|
|
cfg := config.Neo4jConfig{
|
|
|
|
|
URI: cnf.Neo4j.URI,
|
|
|
|
|
Username: cnf.Neo4j.Username,
|
|
|
|
|
Password: cnf.Neo4j.Password,
|
|
|
|
|
}
|
2026-04-13 14:45:14 +08:00
|
|
|
driver := NewDriver(cfg)
|
|
|
|
|
defer driver.Close(context.Background())
|
2026-04-13 14:36:54 +08:00
|
|
|
}
|