2
0

Connect via TCP

fixes #15
This commit is contained in:
Jack Christensen
2013-04-23 08:15:05 -05:00
parent 460acd7757
commit d1a56c95d2
2 changed files with 24 additions and 9 deletions
+12
View File
@@ -53,6 +53,18 @@ func TestConnect(t *testing.T) {
}
}
func TestConnectWithTcp(t *testing.T) {
conn, err := Connect(ConnectionParameters{host: "127.0.0.1", user: "pgx_md5", password: "secret", database: "pgx_test"})
if err != nil {
t.Fatal("Unable to establish connection: " + err.Error())
}
err = conn.Close()
if err != nil {
t.Fatal("Unable to close connection")
}
}
func TestConnectWithInvalidUser(t *testing.T) {
_, err := Connect(ConnectionParameters{socket: "/private/tmp/.s.PGSQL.5432", user: "invalid_user", database: "pgx_test"})
pgErr := err.(PgError)