mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-27 15:36:57 +00:00
feat(test): add mock PVE API server for integration testing
ASP.NET Minimal API project that simulates the Proxmox VE API using existing JSON fixtures. Supports ticket and API token auth, request tracking for assertions, self-signed HTTPS, and all major API endpoints. Designed for programmatic test startup via MockPveServer.Start(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using PSProxmoxVE.MockServer;
|
||||
|
||||
// When run standalone, start on a fixed port
|
||||
using var server = MockPveServer.Start(port: 8006);
|
||||
Console.WriteLine($"Mock Proxmox VE API server running at {server.BaseUrl}");
|
||||
Console.WriteLine("Press Ctrl+C to stop.");
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
Console.CancelKeyPress += (_, e) =>
|
||||
{
|
||||
e.Cancel = true;
|
||||
cts.Cancel();
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
await Task.Delay(Timeout.Infinite, cts.Token);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Graceful shutdown
|
||||
}
|
||||
Reference in New Issue
Block a user