10218: Save the container record as a json file and also write it on the logs.
[arvados.git] / services / keep-balance / main_test.go
index 4a56098b29d1dbb7d8352d02c8ee0b492a6aea76..157ee4574b99b23195917308d73f343716371e2a 100644 (file)
@@ -1,9 +1,9 @@
 package main
 
 import (
-       "encoding/json"
        "time"
 
+       "github.com/ghodss/yaml"
        check "gopkg.in/check.v1"
 )
 
@@ -13,7 +13,7 @@ type mainSuite struct{}
 
 func (s *mainSuite) TestExampleJSON(c *check.C) {
        var config Config
-       c.Check(json.Unmarshal(exampleConfigFile, &config), check.IsNil)
+       c.Check(yaml.Unmarshal(exampleConfigFile, &config), check.IsNil)
        c.Check(config.KeepServiceTypes, check.DeepEquals, []string{"disk"})
        c.Check(config.Client.AuthToken, check.Equals, "xyzzy")
        c.Check(time.Duration(config.RunPeriod), check.Equals, 600*time.Second)
@@ -21,8 +21,7 @@ func (s *mainSuite) TestExampleJSON(c *check.C) {
 
 func (s *mainSuite) TestConfigJSONWithKeepServiceList(c *check.C) {
        var config Config
-       c.Check(json.Unmarshal([]byte(`
-               {
+       c.Check(yaml.Unmarshal([]byte(`{
                    "Client": {
                        "APIHost": "zzzzz.arvadosapi.com:443",
                        "AuthToken": "xyzzy",