change computer
This commit is contained in:
1 parent
7a5c9c79a5
commit
76e166730f
2 files changed
+55
-5
No files matched your search
@@ -1,7 +1,9 @@
|
||||
package payload
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -23,5 +25,26 @@ func TestPayloadGetHashMethod(t *testing.T) {
|
||||
t.Error("bad hash name. supposed to be ", name, " but received", returnedName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetStream(t *testing.T) {
|
||||
p := new(Payload)
|
||||
if s := p.getStream(); s != nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncrypt(t *testing.T) {
|
||||
if true {
|
||||
return
|
||||
}
|
||||
p := new(Payload)
|
||||
data := bytes.NewBufferString("nice string")
|
||||
reader := p.encrypt(data)
|
||||
if outputdata, err := ioutil.ReadAll(reader); err != nil {
|
||||
t.Error(err)
|
||||
} else if string(outputdata) != "nice string" {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user