aboutsummaryrefslogtreecommitdiffstats
path: root/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/config_test.go')
-rw-r--r--config/config_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/config/config_test.go b/config/config_test.go
index d97053b..f2539d0 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -6,6 +6,26 @@ type ConfigSuite struct{}
var _ = Suite(&ConfigSuite{})
+func (s *ConfigSuite) TestConfigValidateInvalidRemote(c *C) {
+ config := &Config{
+ Remotes: map[string]*RemoteConfig{
+ "foo": {Name: "foo"},
+ },
+ }
+
+ c.Assert(config.Validate(), Equals, ErrRemoteConfigEmptyURL)
+}
+
+func (s *ConfigSuite) TestConfigValidateInvalidKey(c *C) {
+ config := &Config{
+ Remotes: map[string]*RemoteConfig{
+ "bar": {Name: "foo"},
+ },
+ }
+
+ c.Assert(config.Validate(), Equals, ErrInvalid)
+}
+
func (s *ConfigSuite) TestRemoteConfigValidateMissingURL(c *C) {
config := &RemoteConfig{Name: "foo"}
c.Assert(config.Validate(), Equals, ErrRemoteConfigEmptyURL)