From cc1ff93250f938dc8fc24d4d757148e2c5111574 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sun, 18 Oct 2015 12:12:33 -0600 Subject: [PATCH] letsencrypt: Fix Windows tests --- config/letsencrypt/storage_test.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/config/letsencrypt/storage_test.go b/config/letsencrypt/storage_test.go index 812f5501..67368669 100644 --- a/config/letsencrypt/storage_test.go +++ b/config/letsencrypt/storage_test.go @@ -1,35 +1,38 @@ package letsencrypt -import "testing" +import ( + "path/filepath" + "testing" +) func TestStorage(t *testing.T) { storage = Storage("./letsencrypt") - if expected, actual := "letsencrypt/sites", storage.Sites(); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "sites"), storage.Sites(); actual != expected { t.Errorf("Expected Sites() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/sites/test.com", storage.Site("test.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "sites", "test.com"), storage.Site("test.com"); actual != expected { t.Errorf("Expected Site() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/sites/test.com/test.com.crt", storage.SiteCertFile("test.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "sites", "test.com", "test.com.crt"), storage.SiteCertFile("test.com"); actual != expected { t.Errorf("Expected SiteCertFile() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/sites/test.com/test.com.key", storage.SiteKeyFile("test.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "sites", "test.com", "test.com.key"), storage.SiteKeyFile("test.com"); actual != expected { t.Errorf("Expected SiteKeyFile() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/sites/test.com/test.com.json", storage.SiteMetaFile("test.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "sites", "test.com", "test.com.json"), storage.SiteMetaFile("test.com"); actual != expected { t.Errorf("Expected SiteMetaFile() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/users", storage.Users(); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "users"), storage.Users(); actual != expected { t.Errorf("Expected Users() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/users/me@example.com", storage.User("me@example.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "users", "me@example.com"), storage.User("me@example.com"); actual != expected { t.Errorf("Expected User() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/users/me@example.com/me.json", storage.UserRegFile("me@example.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "users", "me@example.com", "me.json"), storage.UserRegFile("me@example.com"); actual != expected { t.Errorf("Expected UserRegFile() to return '%s' but got '%s'", expected, actual) } - if expected, actual := "letsencrypt/users/me@example.com/me.key", storage.UserKeyFile("me@example.com"); actual != expected { + if expected, actual := filepath.Join("letsencrypt", "users", "me@example.com", "me.key"), storage.UserKeyFile("me@example.com"); actual != expected { t.Errorf("Expected UserKeyFile() to return '%s' but got '%s'", expected, actual) } }