From 62e212abf452f66dd0e88b4c4dbcc443b909a5a1 Mon Sep 17 00:00:00 2001 From: Samuel Hawksby-Robinson Date: Wed, 15 Jun 2022 14:52:14 +0100 Subject: [PATCH] Fixed Suite test --- VERSION | 2 +- server/ips_test.go | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index a954be764..69eaa55de 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.101.4 +0.102.3 diff --git a/server/ips_test.go b/server/ips_test.go index eb0a957b5..6052643e1 100644 --- a/server/ips_test.go +++ b/server/ips_test.go @@ -49,39 +49,40 @@ func makeThingToSay() (string, error) { return hex.EncodeToString(b), nil } -func (s *GetOutboundIPSuite) TestGetOutboundIPWithFullServerE2e(t *testing.T) { - s.PS.SetHandlers(HandlerPatternMap{"/hello": testHandler(t)}) +func (s *GetOutboundIPSuite) TestGetOutboundIPWithFullServerE2e() { + s.PS.mode = Sending + s.PS.SetHandlers(HandlerPatternMap{"/hello": testHandler(s.T())}) err := s.PS.Start() - require.NoError(t, err) + s.Require().NoError(err) // Give time for the sever to be ready, hacky I know, I'll iron this out time.Sleep(100 * time.Millisecond) // Server generates a QR code connection string cp, err := s.PS.MakeConnectionParams() - require.NoError(t, err) + s.Require().NoError(err) qr, err := cp.ToString() - require.NoError(t, err) + s.Require().NoError(err) // Client reads QR code and parses the connection string ccp := new(ConnectionParams) err = ccp.FromString(qr) - require.NoError(t, err) + s.Require().NoError(err) c, err := NewPairingClient(ccp) - require.NoError(t, err) + s.Require().NoError(err) thing, err := makeThingToSay() - require.NoError(t, err) + s.Require().NoError(err) response, err := c.Get(c.baseAddress.String() + "/hello?say=" + thing) - require.NoError(t, err) + s.Require().NoError(err) defer response.Body.Close() content, err := ioutil.ReadAll(response.Body) - require.NoError(t, err) - require.Equal(t, "Hello I like to be a tls server. You said: `"+thing+"`", string(content[:109])) + s.Require().NoError(err) + s.Require().Equal("Hello I like to be a tls server. You said: `"+thing+"`", string(content[:109])) }