feat: Implement AWS region aliases (#646)

This commit is contained in:
Mike Sampson
2019-12-21 04:30:47 +11:00
committed by Matan Kushner
parent f3784f5aaa
commit 256a2be949
5 changed files with 53 additions and 6 deletions
+15
View File
@@ -28,6 +28,21 @@ fn region_set() -> io::Result<()> {
Ok(())
}
#[test]
fn region_set_with_alias() -> io::Result<()> {
let output = common::render_module("aws")
.env("AWS_REGION", "ap-southeast-2")
.use_config(toml::toml! {
[aws.region_aliases]
ap-southeast-2 = "au"
})
.output()?;
let expected = format!("on {} ", Color::Yellow.bold().paint("☁️ au"));
let actual = String::from_utf8(output.stdout).unwrap();
assert_eq!(expected, actual);
Ok(())
}
#[test]
fn default_region_set() -> io::Result<()> {
let output = common::render_module("aws")