File: client_test.go

package info (click to toggle)
golang-github-koofr-go-koofrclient 0.0~git20190724.8e5366d-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 136 kB
  • sloc: makefile: 5
file content (24 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package koofrclient_test

import (
	k "github.com/koofr/go-koofrclient"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Client", func() {
	It("should create client with token", func() {
		c := k.NewKoofrClient(apiBase, true)
		Expect(c).NotTo(BeNil())
		c.SetToken("eac6e8d7-edea-4af1-92db-9636795379d1")
		Expect(c).NotTo(BeNil())
	})

	It("should create client and authorize", func() {
		c := k.NewKoofrClient(apiBase, true)
		Expect(c).NotTo(BeNil())
		err := c.Authenticate(email, password)
		Expect(err).NotTo(HaveOccurred())
		Expect(c.GetToken()).To(HaveLen(36))
	})
})