1
0
mirror of https://github.com/drakkan/sftpgo.git synced 2025-11-29 22:08:10 +02:00

api_utils: expose missing REST API

REST API are now fully exposed and can be consumed by other packages
using the methods in api_utils.go
This commit is contained in:
Nicola Murino
2019-08-03 13:19:00 +02:00
parent b8dafecdd9
commit d2361da570
3 changed files with 110 additions and 0 deletions

View File

@@ -383,6 +383,20 @@ func TestStartQuotaScan(t *testing.T) {
}
}
func TestGetSFTPConnections(t *testing.T) {
_, err := api.GetSFTPConnections(http.StatusOK)
if err != nil {
t.Errorf("unable to get sftp connections: %v", err)
}
}
func TestCloseActiveSFTPConnection(t *testing.T) {
err := api.CloseSFTPConnection("non_existent_id", http.StatusNotFound)
if err != nil {
t.Errorf("unexpected error closing non existent sftp connection: %v", err)
}
}
// test using mock http server
func TestBasicUserHandlingMock(t *testing.T) {