Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b04f734

Browse filesBrowse files
committed
Added test for generic container parsing
1 parent 669731f commit b04f734
Copy full SHA for b04f734

File tree

1 file changed

+21
-0
lines changed
Filter options

1 file changed

+21
-0
lines changed

‎envs/envs_test.go

Copy file name to clipboardExpand all lines: envs/envs_test.go
+21Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.