client: Since we use one function for testing, also use one function for setting config values
This commit is contained in:
parent
27d71a144b
commit
aa9fced4e1
@ -23,9 +23,7 @@ func TestPlainConnection(t *testing.T) {
|
||||
reactor := NewReactor()
|
||||
client := reactor.CreateServer("local")
|
||||
|
||||
client.InitialNick = "coolguy"
|
||||
client.InitialUser = "c"
|
||||
client.InitialRealName = "girc-go Test Client "
|
||||
initialiseServerConnection(client)
|
||||
|
||||
// we mock up a server connection to test the client
|
||||
listener, _ := net.Listen("tcp", ":0")
|
||||
@ -40,9 +38,7 @@ func TestTLSConnection(t *testing.T) {
|
||||
reactor := NewReactor()
|
||||
client := reactor.CreateServer("local")
|
||||
|
||||
client.InitialNick = "coolguy"
|
||||
client.InitialUser = "c"
|
||||
client.InitialRealName = "girc-go Test Client "
|
||||
initialiseServerConnection(client)
|
||||
|
||||
// generate a test certificate to use
|
||||
priv, _ := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
|
||||
@ -113,6 +109,12 @@ func sendMessage(conn net.Conn, tags *map[string]ircmsg.TagValue, prefix string,
|
||||
time.Sleep(waitTime)
|
||||
}
|
||||
|
||||
func initialiseServerConnection(client *ServerConnection) {
|
||||
client.InitialNick = "coolguy"
|
||||
client.InitialUser = "c"
|
||||
client.InitialRealName = "girc-go Test Client "
|
||||
}
|
||||
|
||||
func testServerConnection(t *testing.T, reactor Reactor, client *ServerConnection, listener net.Listener) {
|
||||
// start our reader
|
||||
conn, _ := listener.Accept()
|
||||
|
Loading…
Reference in New Issue
Block a user