new room unencrypted in matrix, impl matrix recv
This commit is contained in:
@@ -30,3 +30,28 @@ func TestMatrixSend(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMatrixReceive(t *testing.T) {
|
||||
if len(os.Getenv("INTEGRATION")) == 0 {
|
||||
t.Skip("$INTEGRATION not set")
|
||||
}
|
||||
var c config.Config
|
||||
b, err := ioutil.ReadFile("../config.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := json.Unmarshal(b, &c); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var sender Sender = Matrix{
|
||||
homeserver: c.Message.Matrix.Homeserver,
|
||||
username: c.Message.Matrix.Username,
|
||||
token: c.Message.Matrix.Token,
|
||||
room: c.Message.Matrix.Room,
|
||||
}
|
||||
if msgs, err := sender.Receive(); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
t.Logf("%+v", msgs)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user