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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user