diff options
| author | Roberto Alsina <ralsina@netmanagers.com.ar> | 2016-09-13 14:11:06 -0300 |
|---|---|---|
| committer | Roberto Alsina <ralsina@netmanagers.com.ar> | 2016-09-13 14:11:06 -0300 |
| commit | acc4b59760e5a8ecaa25469e67745d3aafea16ba (patch) | |
| tree | 75ca274a1cf44ab3ebcd22e98eb4d25c49885853 /asserts | |
| parent | 1886474b36a2e728b0a13479e95f8cb987cef85e (diff) | |
test fixes
Diffstat (limited to 'asserts')
| -rw-r--r-- | asserts/snap_asserts_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/asserts/snap_asserts_test.go b/asserts/snap_asserts_test.go index e6854251c1..c98909d287 100644 --- a/asserts/snap_asserts_test.go +++ b/asserts/snap_asserts_test.go @@ -109,7 +109,7 @@ func (sds *snapDeclSuite) TestMissingRefreshControl(c *C) { a, err := asserts.Decode([]byte(encoded)) c.Assert(err, IsNil) snapDecl := a.(*asserts.SnapDeclaration) - c.Check(snapDecl.RefreshControl(), DeepEquals, []string(nil)) + c.Check(snapDecl.RefreshControl(), HasLen, 0) } const ( @@ -123,6 +123,7 @@ func (sds *snapDeclSuite) TestDecodeInvalid(c *C) { "snap-id: snap-id-1\n" + "snap-name: first\n" + "publisher-id: dev-id1\n" + + "refresh-control:\n - foo\n - bar\n" + sds.tsLine + "body-length: 0\n" + "sign-key-sha3-384: Jv8_JiHiIzJVcO9M55pPdqSDWUvuhfDIBJUS-3VW7F_idjix7Ffn5qMxB21ZQuij" + @@ -137,6 +138,8 @@ func (sds *snapDeclSuite) TestDecodeInvalid(c *C) { {"snap-name: first\n", "", `"snap-name" header is mandatory`}, {"publisher-id: dev-id1\n", "", `"publisher-id" header is mandatory`}, {"publisher-id: dev-id1\n", "publisher-id: \n", `"publisher-id" header should not be empty`}, + {"refresh-control:\n - foo\n - bar\n", "refresh-control: foo\n", `"refresh-control" header must be a list of strings`}, + {"refresh-control:\n - foo\n - bar\n", "refresh-control:\n -\n - nested\n", `"refresh-control" header must be a list of strings`}, {sds.tsLine, "", `"timestamp" header is mandatory`}, {sds.tsLine, "timestamp: \n", `"timestamp" header should not be empty`}, {sds.tsLine, "timestamp: 12:30\n", `"timestamp" header is not a RFC3339 date: .*`}, |
