Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed May 30, 2018
1 parent 0cc2cfb commit 0bf33f6
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions entry_migrate_test.go
Expand Up @@ -122,27 +122,20 @@ func TestMigrateEntryFromJSON(t *testing.T) {
}

func TestMigrateEntryToJSON(t *testing.T) {
entry, err := genTestMigrateEntry()
if err != nil {
panic(err)
}

Convey("MigrateEntry should convert to JSON and roundtrip safely", t, func() {
var j string
var err error
j, err = entry.ToJSON()
entry, err := genTestMigrateEntry()
So(err, ShouldBeNil)

if err != nil {
panic(err)
}
j, err = entry.ToJSON()
So(err, ShouldBeNil)

So(err, ShouldBeNil)
So(j, ShouldEqual, fmt.Sprintf(`{"Type":"open","DNAHash":"%s","Key":"%s","Data":"%s"}`, entry.DNAHash, entry.Key, entry.Data))

roundtrip, err := MigrateEntryFromJSON(j)
if err != nil {
panic(err)
}
So(err, ShouldBeNil)
So(roundtrip, ShouldResemble, entry)
})
}

0 comments on commit 0bf33f6

Please sign in to comment.