mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
feat(az): configure the az CLI against floci-az with floci az setup (#29)
This commit is contained in:
1 parent
dd38f6dc27
commit
7b58a38c5a
27 files changed
+1587
-12
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package io.floci.cli.unit;
|
||||
|
||||
import io.floci.cli.ProductProfile;
|
||||
import io.floci.cli.config.InstanceState;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class InstanceStateTest {
|
||||
|
||||
private static final Path ROOT = Path.of("/home/u/.floci");
|
||||
|
||||
@Test
|
||||
void oneDirectoryPerProductAndContainer() {
|
||||
assertEquals(ROOT.resolve("az/floci-az"), InstanceState.dir(ROOT, ProductProfile.AZ, "floci-az"));
|
||||
assertEquals(ROOT.resolve("az/floci-az-b"), InstanceState.dir(ROOT, ProductProfile.AZ, "floci-az-b"));
|
||||
assertEquals(ROOT.resolve("gcp/floci-gcp"), InstanceState.dir(ROOT, ProductProfile.GCP, "floci-gcp"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"", " ", ".", "..", "../x", "a/b", "a\\b"})
|
||||
void refusesNamesThatAreNotAContainerName(String name) {
|
||||
assertThrows(IllegalArgumentException.class, () -> InstanceState.dir(ROOT, ProductProfile.AZ, name));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user