Other(test): Prefer native API revoke rather than fake server method

This commit is contained in:
James Houlahan 2022-12-12 10:47:06 +01:00
parent 5f1389f824
commit 49fa451cc3
4 changed files with 6 additions and 4 deletions

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/Masterminds/semver/v3 v3.1.1
github.com/ProtonMail/gluon v0.14.2-0.20221207071431-0faa318d3c9f
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
github.com/ProtonMail/go-proton-api v0.2.1
github.com/ProtonMail/go-proton-api v0.2.2-0.20221212093343-0afe67dc1c50
github.com/ProtonMail/go-rfc5322 v0.11.0
github.com/ProtonMail/gopenpgp/v2 v2.4.10
github.com/PuerkitoBio/goquery v1.8.0

2
go.sum
View File

@ -47,6 +47,8 @@ github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f h1:4IWzKjHzZxdr
github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f/go.mod h1:qRZgbeASl2a9OwmsV85aWwRqic0NHPh+9ewGAzb4cgM=
github.com/ProtonMail/go-proton-api v0.2.1 h1:M15/zzfx6EPiskv2+gogUkmvx7Y1SmRRtLT6GiBh5T0=
github.com/ProtonMail/go-proton-api v0.2.1/go.mod h1:jqvJ2HqLHqiPJoEb+BTIB1IF7wvr6p+8ZfA6PO2NRNk=
github.com/ProtonMail/go-proton-api v0.2.2-0.20221212093343-0afe67dc1c50 h1:DXcvmx1sx20YsFmP40kCRYD+jzBy6OLjvFQFCbht4ZI=
github.com/ProtonMail/go-proton-api v0.2.2-0.20221212093343-0afe67dc1c50/go.mod h1:jqvJ2HqLHqiPJoEb+BTIB1IF7wvr6p+8ZfA6PO2NRNk=
github.com/ProtonMail/go-rfc5322 v0.11.0 h1:o5Obrm4DpmQEffvgsVqG6S4BKwC1Wat+hYwjIp2YcCY=
github.com/ProtonMail/go-rfc5322 v0.11.0/go.mod h1:6oOKr0jXvpoE6pwTx/HukigQpX2J9WUf6h0auplrFTw=
github.com/ProtonMail/go-srp v0.0.5 h1:xhUioxZgDbCnpo9JehyFhwwsn9JLWkUGfB0oiKXgiGg=

View File

@ -29,8 +29,6 @@ type API interface {
AddCallWatcher(func(server.Call), ...string)
CreateUser(username, address string, password []byte) (string, string, error)
RevokeUser(userID string) error
CreateAddress(userID, address string, password []byte) (string, error)
RemoveAddress(userID, addrID string) error
RemoveAddressKey(userID, addrID, keyID string) error

View File

@ -310,7 +310,9 @@ func (s *scenario) userIsDeleted(username string) error {
}
func (s *scenario) theAuthOfUserIsRevoked(username string) error {
return s.t.api.RevokeUser(s.t.getUserID(username))
return s.t.withClient(context.Background(), username, func(ctx context.Context, client *proton.Client) error {
return client.AuthRevokeAll(ctx)
})
}
func (s *scenario) userIsListedAndConnected(username string) error {