initialize/env: add notes about tests

This commit is contained in:
Jonathan Boulle 2014-06-24 18:52:08 -07:00
parent 439b7e8b98
commit 2805d70ece

View File

@ -14,6 +14,8 @@ func TestEnvironmentApply(t *testing.T) {
out string out string
}{ }{
{ {
// Substituting both values directly should always take precedence
// over environment variables
map[string]string{ map[string]string{
"$public_ipv4": "192.0.2.3", "$public_ipv4": "192.0.2.3",
"$private_ipv4": "192.0.2.203", "$private_ipv4": "192.0.2.203",
@ -28,11 +30,13 @@ ExecStop=/usr/bin/echo 192.0.2.203
ExecStop=/usr/bin/echo $unknown`, ExecStop=/usr/bin/echo $unknown`,
}, },
{ {
// Substituting one value directly while falling back with the other
map[string]string{"$private_ipv4": "127.0.0.1"}, map[string]string{"$private_ipv4": "127.0.0.1"},
"$private_ipv4\n$public_ipv4", "$private_ipv4\n$public_ipv4",
"127.0.0.1\n1.2.3.4", "127.0.0.1\n1.2.3.4",
}, },
{ {
// Falling back to environment variables for both values
map[string]string{"foo": "bar"}, map[string]string{"foo": "bar"},
"$private_ipv4\n$public_ipv4", "$private_ipv4\n$public_ipv4",
"5.6.7.8\n1.2.3.4", "5.6.7.8\n1.2.3.4",