From 0d5bc543794198433536d4dc6e31c61554289217 Mon Sep 17 00:00:00 2001 From: Hu Shuai Date: Wed, 8 Apr 2020 11:49:50 +0800 Subject: [PATCH] test: add unit test case for func GetSuperCID Signed-off-by: Hu Shuai --- supernode/config/config_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/supernode/config/config_test.go b/supernode/config/config_test.go index cf177fa63..b9af02d55 100644 --- a/supernode/config/config_test.go +++ b/supernode/config/config_test.go @@ -84,3 +84,11 @@ func (s *SupernodeConfigTestSuite) TestConfig_Load(c *check.C) { p := &PluginProperties{Name: "local", Enabled: true, Config: "baseDir: /tmp/supernode/repo\n"} c.Assert(conf.Plugins[StoragePlugin][0], check.DeepEquals, p) } + +func (s *SupernodeConfigTestSuite) TestGetSuperCID(c *check.C) { + conf := Config{ + BaseProperties: &BaseProperties{cIDPrefix: "CIDPrefix"}, + } + + c.Assert(conf.GetSuperCID("taskID"), check.DeepEquals, "CIDPrefixtaskID") +}