def test_control_listen_ip(self):
     relation = mock.MagicMock()
     self.patch(designate_bind.ch_ip, 'get_relation_ip')
     self.patch(designate_bind.hookenv, 'unit_private_ip')
     self.get_relation_ip.return_value = 'ip1'
     a = designate_bind.DNSAdapter(relation)
     self.assertEqual(a.control_listen_ip, 'ip1')
 def test_secret(self):
     relation = mock.MagicMock()
     self.patch(designate_bind.DesignateBindCharm, 'get_rndc_secret')
     self.get_rndc_secret.return_value = 'secret1'
     a = designate_bind.DNSAdapter(relation)
     self.assertEqual(a.secret, 'secret1')
 def test_algorithm(self):
     relation = mock.MagicMock()
     self.patch(designate_bind.DesignateBindCharm, 'get_rndc_algorithm')
     self.get_rndc_algorithm.return_value = 'algo1'
     a = designate_bind.DNSAdapter(relation)
     self.assertEqual(a.algorithm, 'algo1')
 def test_control_ips(self):
     relation = mock.MagicMock()
     relation.client_ips.return_value = ['ip1', 'ip2']
     a = designate_bind.DNSAdapter(relation)
     self.assertEqual(a.control_ips, 'ip1;ip2')