From 7c016b655b54efd5a4bb97a5a3a0f92c0df9c06c Mon Sep 17 00:00:00 2001 From: fahedouch Date: Fri, 1 Nov 2019 11:14:19 +0100 Subject: [PATCH] add tests to server_test Signed-off-by: fahedouch --- services/server/server_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/services/server/server_test.go b/services/server/server_test.go index 2dc342c70..8a3b6b88c 100644 --- a/services/server/server_test.go +++ b/services/server/server_test.go @@ -32,3 +32,23 @@ func TestCreateTopLevelDirectoriesErrorsWithSamePathForRootAndState(t *testing.T }) assert.Check(t, is.Error(err, "root and state must be different paths")) } + +func TestCreateTopLevelDirectoriesWithEmptyStatePath(t *testing.T) { + statePath := "" + rootPath := "/tmp/path/for/testing" + err := CreateTopLevelDirectories(&srvconfig.Config{ + Root: rootPath, + State: statePath, + }) + assert.Check(t, is.Error(err, "state must be specified")) +} + +func TestCreateTopLevelDirectoriesWithEmptyRootPath(t *testing.T) { + statePath := "/tmp/path/for/testing" + rootPath := "" + err := CreateTopLevelDirectories(&srvconfig.Config{ + Root: rootPath, + State: statePath, + }) + assert.Check(t, is.Error(err, "root must be specified")) +}