refactor: remove outdated test for hostname and port parsing in Caddy configuration
All checks were successful
Caddy Manager CI build / docker (push) Successful in 54s
All checks were successful
Caddy Manager CI build / docker (push) Successful in 54s
This commit is contained in:
@@ -664,36 +664,5 @@ api.test {
|
|||||||
stopwatch.ElapsedMilliseconds.Should().BeLessThan(1000); // Should process in under 1 second
|
stopwatch.ElapsedMilliseconds.Should().BeLessThan(1000); // Should process in under 1 second
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Tests the parsing issue where the provided configuration is incorrectly parsed as 2 sites and 0 ports
|
|
||||||
/// instead of 1 site and 1 port.
|
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
|
||||||
public void GetHostnamesAndPortsFromCaddyfileContent_WithProvidedConfiguration_ReturnsCorrectSiteAndPort()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
var caddyfileContent = @"pika-auth.duydao.org {
|
|
||||||
reverse_proxy pikachu:3011 {
|
|
||||||
header_down X-Frame-Options """"
|
|
||||||
}
|
|
||||||
encode zstd gzip
|
|
||||||
}";
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var hostnames = _service.GetHostnamesFromCaddyfileContent(caddyfileContent);
|
|
||||||
var ports = _service.GetReverseProxyPortsFromCaddyfileContent(caddyfileContent);
|
|
||||||
|
|
||||||
// Assert - Should have 1 site and 1 port
|
|
||||||
hostnames.Should().NotBeNull();
|
|
||||||
hostnames.Should().HaveCount(1);
|
|
||||||
hostnames.Should().Contain("pika-auth.duydao.org");
|
|
||||||
|
|
||||||
ports.Should().NotBeNull();
|
|
||||||
ports.Should().HaveCount(1);
|
|
||||||
ports.Should().Contain(3011);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user