8000 Added test for generic container parsing · symfony-cli/symfony-cli@b04f734 · GitHub
[go: up one dir, main page]

Skip to content

Commit b04f734

committed
Added test for generic container parsing
1 parent 669731f commit b04f734

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

envs/envs_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@ func (f fakeEnv) Local() bool {
7070
return true
7171
}
7272

73+
func (s *ScenvSuite) TestGenericContainerExposesHostAndPort(c *C) {
74+
env := fakeEnv{
75+
Rels: map[string][]map[string]interface{}{
76+
"container": {
77+
map[string]interface{}{
78+
"host": "localhost",
79+
"ip": "127.0.0.1",
80+
"port": 9200,
81+
"rel": "simple",
82+
"scheme": "undefined",
83+
},
84+
},
85+
},
86+
}
87+
88+
rels := extractRelationshipsEnvs(env)
89+
c.Assert(rels["CONTAINER_HOST"], Equals, "localhost")
90+
c.Assert(rels["CONTAINER_PORT"], Equals, "9200")
91+
c.Assert(rels["CONTAINER_IP"], Equals, "127.0.0.1")
92+
}
93+
7394
func (s *ScenvSuite) TestElasticsearchURLEndsWithTrailingSlash(c *C) {
7495
env := fakeEnv{
7596
Rels: map[string][]map[string]interface{}{

0 commit comments

Comments
 (0)
0