@@ -137,49 +137,52 @@ def test_tag_create_with_ids(self):
137137 """
138138 Tests that creating a tag with IDs sends the correct request
139139 """
140- instance = self .client .linode .instances (). first ()
141- domain = self .client .domains ().first ()
142- nodebalancer = self .client .nodebalancers (). first ()
143- volume = self .client .volumes (). first ()
140+ instance1 , instance2 = self .client .linode .instances ()[: 2 ]
141+ domain1 = self .client .domains ().first ()
142+ nodebalancer1 , nodebalancer2 = self .client .nodebalancers ()[: 2 ]
143+ volume1 , volume2 = self .client .volumes ()[: 2 ]
144144
145145 # tags don't work like a normal RESTful collection, so we have to do this
146146 with self .mock_post ({'label' :'pytest' }) as m :
147- t = self .client .tag_create ('pytest' , instances = [instance .id ],
148- nodebalancers = [nodebalancer .id ],
149- domains = [domain .id ], volumes = [volume .id ])
147+ t = self .client .tag_create ('pytest' ,
148+ instances = [instance1 .id , instance2 ],
149+ nodebalancers = [nodebalancer1 .id , nodebalancer2 ],
150+ domains = [domain1 .id ],
151+ volumes = [volume1 .id , volume2 ])
150152
151153 self .assertIsNotNone (t )
152154 self .assertEqual (t .label , 'pytest' )
153155
154156 self .assertEqual (m .call_url , '/tags' )
155157 self .assertEqual (m .call_data , {
156158 'label' : 'pytest' ,
157- 'linodes' : [instance .id ],
158- 'domains' : [domain .id ],
159- 'nodebalancers' : [nodebalancer .id ],
160- 'volumes' : [volume .id ],
159+ 'linodes' : [instance1 . id , instance2 .id ],
160+ 'domains' : [domain1 .id ],
161+ 'nodebalancers' : [nodebalancer1 . id , nodebalancer2 .id ],
162+ 'volumes' : [volume1 . id , volume2 .id ],
161163 })
162164
163165 def test_tag_create_with_entities (self ):
164166 """
165167 Tests that creating a tag with entities sends the correct request
166168 """
167- instance = self .client .linode .instances (). first ()
169+ instance1 , instance2 = self .client .linode .instances ()[: 2 ]
168170 domain = self .client .domains ().first ()
169171 nodebalancer = self .client .nodebalancers ().first ()
170172 volume = self .client .volumes ().first ()
171173
172174 # tags don't work like a normal RESTful collection, so we have to do this
173175 with self .mock_post ({'label' :'pytest' }) as m :
174- t = self .client .tag_create ('pytest' , entities = [instance , domain , nodebalancer , volume ])
176+ t = self .client .tag_create ('pytest' ,
177+ entities = [instance1 , domain , nodebalancer , volume , instance2 ])
175178
176179 self .assertIsNotNone (t )
177180 self .assertEqual (t .label , 'pytest' )
178181
179182 self .assertEqual (m .call_url , '/tags' )
180183 self .assertEqual (m .call_data , {
181184 'label' : 'pytest' ,
182- 'linodes' : [instance .id ],
185+ 'linodes' : [instance1 . id , instance2 .id ],
183186 'domains' : [domain .id ],
184187 'nodebalancers' : [nodebalancer .id ],
185188 'volumes' : [volume .id ],
0 commit comments