77 "golang.org/x/net/context"
88
99 "github.com/docker/engine-api/types"
10+ "github.com/docker/libcompose/labels"
1011 "github.com/docker/libcompose/test"
1112)
1213
@@ -66,7 +67,7 @@ func TestDefaultNamerLabelNotANumber(t *testing.T) {
6667 containers : []types.Container {
6768 {
6869 Labels : map [string ]string {
69- ONEOFF .Str (): "IAmAString" ,
70+ labels . ONEOFF .Str (): "IAmAString" ,
7071 },
7172 },
7273 },
@@ -93,9 +94,9 @@ func TestDefaultNamer(t *testing.T) {
9394 oneOff : false ,
9495 containers : []types.Container {},
9596 expectedLabels : []string {
96- fmt .Sprintf ("%s=" , PROJECT .Str ()),
97- fmt .Sprintf ("%s=" , SERVICE .Str ()),
98- fmt .Sprintf ("%s=False" , ONEOFF .Str ()),
97+ fmt .Sprintf ("%s=" , labels . PROJECT .Str ()),
98+ fmt .Sprintf ("%s=" , labels . SERVICE .Str ()),
99+ fmt .Sprintf ("%s=False" , labels . ONEOFF .Str ()),
99100 },
100101 expectedName : "__1" ,
101102 expectedNumber : 1 ,
@@ -106,9 +107,9 @@ func TestDefaultNamer(t *testing.T) {
106107 oneOff : false ,
107108 containers : []types.Container {},
108109 expectedLabels : []string {
109- fmt .Sprintf ("%s=project" , PROJECT .Str ()),
110- fmt .Sprintf ("%s=service" , SERVICE .Str ()),
111- fmt .Sprintf ("%s=False" , ONEOFF .Str ()),
110+ fmt .Sprintf ("%s=project" , labels . PROJECT .Str ()),
111+ fmt .Sprintf ("%s=service" , labels . SERVICE .Str ()),
112+ fmt .Sprintf ("%s=False" , labels . ONEOFF .Str ()),
112113 },
113114 expectedName : "project_service_1" ,
114115 expectedNumber : 1 ,
@@ -120,14 +121,14 @@ func TestDefaultNamer(t *testing.T) {
120121 containers : []types.Container {
121122 {
122123 Labels : map [string ]string {
123- NUMBER .Str (): "1" ,
124+ labels . NUMBER .Str (): "1" ,
124125 },
125126 },
126127 },
127128 expectedLabels : []string {
128- fmt .Sprintf ("%s=project" , PROJECT .Str ()),
129- fmt .Sprintf ("%s=service" , SERVICE .Str ()),
130- fmt .Sprintf ("%s=False" , ONEOFF .Str ()),
129+ fmt .Sprintf ("%s=project" , labels . PROJECT .Str ()),
130+ fmt .Sprintf ("%s=service" , labels . SERVICE .Str ()),
131+ fmt .Sprintf ("%s=False" , labels . ONEOFF .Str ()),
131132 },
132133 expectedName : "project_service_2" ,
133134 expectedNumber : 2 ,
@@ -139,14 +140,14 @@ func TestDefaultNamer(t *testing.T) {
139140 containers : []types.Container {
140141 {
141142 Labels : map [string ]string {
142- NUMBER .Str (): "10" ,
143+ labels . NUMBER .Str (): "10" ,
143144 },
144145 },
145146 },
146147 expectedLabels : []string {
147- fmt .Sprintf ("%s=project" , PROJECT .Str ()),
148- fmt .Sprintf ("%s=anotherservice" , SERVICE .Str ()),
149- fmt .Sprintf ("%s=False" , ONEOFF .Str ()),
148+ fmt .Sprintf ("%s=project" , labels . PROJECT .Str ()),
149+ fmt .Sprintf ("%s=anotherservice" , labels . SERVICE .Str ()),
150+ fmt .Sprintf ("%s=False" , labels . ONEOFF .Str ()),
150151 },
151152 expectedName : "project_anotherservice_11" ,
152153 expectedNumber : 11 ,
0 commit comments