From 77794be7dbd189f3b7107d023dca6617e1c9b5b7 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Thu, 9 Feb 2017 08:03:48 -0800 Subject: [PATCH] fix tests for new inits --- examples/echobot/main.go | 2 +- standardricochetservice_bad_usage_error_test.go | 4 ++-- standardricochetservice_test.go | 10 +++++----- standardricochetservice_unauth_test.go | 4 ++-- standardricochetservice_unknown_contact_test.go | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/echobot/main.go b/examples/echobot/main.go index 604af11..fbc2ad1 100644 --- a/examples/echobot/main.go +++ b/examples/echobot/main.go @@ -36,6 +36,6 @@ func (ebs *EchoBotService) OnChatMessage(oc *goricochet.OpenConnection, channelI func main() { ricochetService := new(EchoBotService) - ricochetService.Init("./private_key") + ricochetService.InitFromKeyFile("./private_key") ricochetService.Listen(ricochetService, 12345) } diff --git a/standardricochetservice_bad_usage_error_test.go b/standardricochetservice_bad_usage_error_test.go index 104fe7a..fe954c4 100644 --- a/standardricochetservice_bad_usage_error_test.go +++ b/standardricochetservice_bad_usage_error_test.go @@ -77,7 +77,7 @@ func (ts *TestBadUsageService) IsKnownContact(hostname string) bool { func TestBadUsageServer(t *testing.T) { ricochetService := new(TestBadUsageService) - err := ricochetService.Init("./private_key") + err := ricochetService.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) @@ -88,7 +88,7 @@ func TestBadUsageServer(t *testing.T) { time.Sleep(time.Second * 2) ricochetService2 := new(TestBadUsageService) - err = ricochetService2.Init("./private_key") + err = ricochetService2.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) diff --git a/standardricochetservice_test.go b/standardricochetservice_test.go index c7eb21e..598fe99 100644 --- a/standardricochetservice_test.go +++ b/standardricochetservice_test.go @@ -55,7 +55,7 @@ func (ts *TestService) IsKnownContact(hostname string) bool { func TestServer(t *testing.T) { ricochetService := new(TestService) - err := ricochetService.Init("./private_key") + err := ricochetService.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) @@ -66,7 +66,7 @@ func TestServer(t *testing.T) { time.Sleep(time.Second * 2) ricochetService2 := new(TestService) - err = ricochetService2.Init("./private_key") + err = ricochetService2.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) @@ -87,7 +87,7 @@ func TestServer(t *testing.T) { func TestServerInvalidKey(t *testing.T) { ricochetService := new(TestService) - err := ricochetService.Init("./private_key.does.not.exist") + err := ricochetService.InitFromKeyFile("./private_key.does.not.exist") if err == nil { t.Errorf("Should not have initate ricochet service, private key should not exist") @@ -96,7 +96,7 @@ func TestServerInvalidKey(t *testing.T) { func TestServerCouldNotConnect(t *testing.T) { ricochetService := new(TestService) - err := ricochetService.Init("./private_key") + err := ricochetService.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) } @@ -108,7 +108,7 @@ func TestServerCouldNotConnect(t *testing.T) { func TestGetServerHostname(t *testing.T) { ricochetService := new(TestService) - err := ricochetService.Init("./private_key") + err := ricochetService.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) } diff --git a/standardricochetservice_unauth_test.go b/standardricochetservice_unauth_test.go index df2c67c..fa87885 100644 --- a/standardricochetservice_unauth_test.go +++ b/standardricochetservice_unauth_test.go @@ -32,7 +32,7 @@ func (ts *TestUnauthorizedService) OnFailedChannelOpen(oc *OpenConnection, chann func TestUnauthorizedClientReject(t *testing.T) { ricochetService := new(TestService) - err := ricochetService.Init("./private_key") + err := ricochetService.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) @@ -43,7 +43,7 @@ func TestUnauthorizedClientReject(t *testing.T) { time.Sleep(time.Second * 2) ricochetService2 := new(TestUnauthorizedService) - err = ricochetService2.Init("./private_key") + err = ricochetService2.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) diff --git a/standardricochetservice_unknown_contact_test.go b/standardricochetservice_unknown_contact_test.go index ba49fb4..ff18fd0 100644 --- a/standardricochetservice_unknown_contact_test.go +++ b/standardricochetservice_unknown_contact_test.go @@ -29,7 +29,7 @@ func (ts *TestUnknownContactService) IsKnownContact(hostname string) bool { func TestUnknownContactServer(t *testing.T) { ricochetService := new(StandardRicochetService) - err := ricochetService.Init("./private_key") + err := ricochetService.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err) @@ -40,7 +40,7 @@ func TestUnknownContactServer(t *testing.T) { time.Sleep(time.Second * 2) ricochetService2 := new(TestUnknownContactService) - err = ricochetService2.Init("./private_key") + err = ricochetService2.InitFromKeyFile("./private_key") if err != nil { t.Errorf("Could not initate ricochet service: %v", err)