Go client for the Write.as API https://developers.write.as

auth_test.go 306B

12345678910111213141516171819
  1. package writeas
  2. import "testing"
  3. func TestAuthentication(t *testing.T) {
  4. dwac := NewDevClient()
  5. // Log in
  6. _, err := dwac.LogIn("demo", "demo")
  7. if err != nil {
  8. t.Fatalf("Unable to log in: %v", err)
  9. }
  10. // Log out
  11. err = dwac.LogOut()
  12. if err != nil {
  13. t.Fatalf("Unable to log out: %v", err)
  14. }
  15. }