Skip to content

Commit 052f597

Browse files
committed
Added the file not found test
1 parent f7ac5b7 commit 052f597

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/KubernetesClientConfigurationTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ public class KubernetesClientConfigurationTests
2323
/// </summary>
2424
private static readonly string kubeConfigUserPassword = "assets/kubeconfig.user-pass.yml";
2525

26+
/// <summary>
27+
/// The configuration file is not present. An KubeConfigException should be thrown
28+
/// </summary>
29+
[Fact]
30+
public void ConfigurationFileNotFound()
31+
{
32+
var fi = new FileInfo("/path/to/nowhere");
33+
Assert.Throws<k8s.Exceptions.KubeConfigException>(() => new KubernetesClientConfiguration(fi));
34+
}
35+
2636
/// <summary>
2737
/// Checks Host is loaded from the default configuration file
2838
/// </summary>

0 commit comments

Comments
 (0)