(t *testing.T)
| 154 | } |
| 155 | |
| 156 | func TestInitLocalKeyPair_error(t *testing.T) { |
| 157 | Convey("hash not match", t, func() { |
| 158 | defer os.Remove("./.HashNotMatch") |
| 159 | enc, _ := symmetric.EncryptWithPassword(bytes.Repeat([]byte("a"), 64), []byte(password), []byte(salt)) |
| 160 | ioutil.WriteFile("./.HashNotMatch", enc, 0600) |
| 161 | err := InitLocalKeyPair("./.HashNotMatch", []byte(password)) |
| 162 | So(err, ShouldEqual, ErrHashNotMatch) |
| 163 | }) |
| 164 | Convey("ErrNotKeyFile", t, func() { |
| 165 | defer os.Remove("./.ErrNotKeyFile") |
| 166 | enc, _ := symmetric.EncryptWithPassword(bytes.Repeat([]byte("a"), 65), []byte(password), []byte(salt)) |
| 167 | ioutil.WriteFile("./.ErrNotKeyFile", enc, 0600) |
| 168 | err := InitLocalKeyPair("./.ErrNotKeyFile", []byte(password)) |
| 169 | So(err, ShouldEqual, ErrNotKeyFile) |
| 170 | }) |
| 171 | } |
nothing calls this directly
no test coverage detected