def test_image_service_joined_specified_interface(self, _canonical_url):
     _canonical_url.return_value = 'http://glancehost'
     relations.image_service_joined(relation_id='image-service:1')
     args = {
         'glance-api-ready': 'no',
         'glance-api-server': 'http://glancehost:9292',
         'relation_id': 'image-service:1',
     }
     self.relation_set.assert_called_with(**args)
 def test_image_service_joined_specified_interface(self, _canonical_url):
     _canonical_url.return_value = 'http://glancehost'
     relations.image_service_joined(relation_id='image-service:1')
     args = {
         'glance-api-ready': 'no',
         'glance-api-server': 'http://glancehost:9292',
         'relation_id': 'image-service:1',
     }
     self.relation_set.assert_called_with(**args)
 def test_image_service_joined_leader(self):
     self.eligible_leader.return_value = True
     self.canonical_url.return_value = 'http://glancehost'
     relations.image_service_joined()
     args = {
         'glance-api-server': 'http://glancehost:9292',
         'relation_id': None
     }
     self.relation_set.assert_called_with(**args)
 def test_image_service_joined_leader(self, _canonical_url, _api_ready):
     _api_ready.return_value = True
     _canonical_url.return_value = 'http://glancehost'
     relations.image_service_joined()
     args = {
         'glance-api-ready': 'yes',
         'glance-api-server': 'http://glancehost:9292',
         'relation_id': None
     }
     self.relation_set.assert_called_with(**args)
 def test_image_service_joined_leader(self, _canonical_url, _api_ready):
     _api_ready.return_value = True
     _canonical_url.return_value = 'http://glancehost'
     relations.image_service_joined()
     args = {
         'glance-api-ready': 'yes',
         'glance-api-server': 'http://glancehost:9292',
         'relation_id': None
     }
     self.relation_set.assert_called_with(**args)
 def test_image_service_joined_not_leader(self):
     self.eligible_leader.return_value = False
     relations.image_service_joined()
     self.assertFalse(self.relation_set.called)