def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_desec.dns_desec import Authenticator path = os.path.join(self.tempdir, "file.ini") dns_test_common.write( { "desec_token": FAKE_TOKEN, "desec_endpoint": FAKE_ENDPOINT, }, path, ) super(AuthenticatorTest, self).setUp() self.config = mock.MagicMock( desec_credentials=path, desec_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "desec") self.mock_zone = {'name': DOMAIN, 'minimum_ttl': 42} self.mock_client = mock.MagicMock() self.mock_client.get_authoritative_zone.return_value = self.mock_zone self.mock_client.get_txt_rrset.return_value = self.TXT # _get_desec_client | pylint: disable=protected-access self.auth._get_desec_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_powerdns.dns_powerdns import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write( { "powerdns_api_url": API_URL, "powerdns_api_key": API_TOKEN }, path) print("File content") print(open(path).read()) self.config = mock.MagicMock( powerdns_credentials=path, powerdns_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "powerdns") self.mock_client = mock.MagicMock() # _get_powerdns_client | pylint: disable=protected-access self.auth._get_powerdns_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_joker.dns_joker import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write( { # 'certbot_dns_joker:dns_joker_username': FAKE_USERNAME, # 'certbot_dns_joker:dns_joker_password': FAKE_PASSWORD, 'joker_username': FAKE_USERNAME, 'joker_password': FAKE_PASSWORD, }, path) self.config = mock.MagicMock( joker_credentials=path, joker_propagation_seconds=0) # don't wait during tests # self.auth = Authenticator(self.config, "certbot_dns_joker:dns_joker") self.auth = Authenticator(self.config, "joker") self.mock_client = mock.MagicMock() # _get_joker_client | pylint: disable=protected-access self.auth._get_joker_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_dnspod.dns_dnspod import Authenticator path = os.path.join(self.tempdir, "file.ini") dns_test_common.write( { "dnspod_api_token": FAKE_API_TOKEN, "dnspod_dns_ttl": FAKE_DNS_TTL, "dnspod_contact_email": FAKE_CONTACT_EMAIL, }, path, ) super(AuthenticatorTest, self).setUp() self.config = mock.MagicMock( dnspod_credentials=path, dnspod_propagation_seconds=0 ) # don't wait during tests self.auth = Authenticator(self.config, "dnspod") self.mock_client = mock.MagicMock() # _get_dnspod_client | pylint: disable=protected-access self.auth._get_dnspod_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_ispconfig.dns_ispconfig import Authenticator path = os.path.join(self.tempdir, "file.ini") dns_test_common.write( { "ispconfig_username": FAKE_USER, "ispconfig_password": FAKE_PW, "ispconfig_endpoint": FAKE_ENDPOINT, }, path, ) super(AuthenticatorTest, self).setUp() self.config = mock.MagicMock( ispconfig_credentials=path, ispconfig_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "ispconfig") self.mock_client = mock.MagicMock() # _get_ispconfig_client | pylint: disable=protected-access self.auth._get_ispconfig_client = mock.MagicMock( return_value=self.mock_client)
def test_config_missing_auth(self): # Test no auth info dns_test_common.write({}, self.sp_config.azure_config) with self.assertRaises(errors.PluginError) as cm: self.auth.perform(SINGLE_DOMAIN) self.assertIn('No authentication methods have been configured', cm.exception.args[0])
def test_api_token(self): dns_test_common.write({"cloudflare_api_token": API_TOKEN}, self.config.cloudflare_credentials) self.auth.perform([self.achall]) expected = [mock.call.add_txt_record(DOMAIN, '_acme-challenge.'+DOMAIN, mock.ANY, mock.ANY)] self.assertEqual(expected, self.mock_client.mock_calls)
def setUp(self): from certbot_dns_acmedns.dns_acmedns import Authenticator super(AuthenticatorTest, self).setUp() self.reg_file = os.path.join(self.tempdir, 'acmedns-registration.json') with open(self.reg_file, 'w') as fp: json.dump(ACMEDNS_REGISTRATION, fp) filesystem.chmod(self.reg_file, 0o600) path = os.path.join(self.tempdir, 'certbot-acmedns-credentials.ini') dns_test_common.write( { "acmedns_api_url": ACMEDNS_URL, "acmedns_registration_file": self.reg_file }, path) self.config = mock.MagicMock( acmedns_credentials=path, acmedns_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "acmedns") self.mock_client = mock.MagicMock() # _get_acmedns_client | pylint: disable=protected-access self.auth._get_acmedns_client = mock.MagicMock( return_value=self.mock_client)
def test_valid_file(self): path = os.path.join(self.tempdir, 'too-permissive-file.ini') dns_test_common.write({"test": "value", "other": 1}, path) credentials_configuration = dns_common.CredentialsConfiguration(path) self.assertEqual("value", credentials_configuration.conf("test")) self.assertEqual("1", credentials_configuration.conf("other"))
def test_invalid_algorithm_raises(self): config = VALID_CONFIG.copy() config["rfc2136_algorithm"] = "INVALID" dns_test_common.write(config, self.config.rfc2136_credentials) self.assertRaises(errors.PluginError, self.auth.perform, [self.achall])
def test_missing_email_or_key(self): dns_test_common.write({"cloudflare_api_key": API_KEY}, self.config.cloudflare_credentials) self.assertRaises(errors.PluginError, self.auth.perform, [self.achall]) dns_test_common.write({"cloudflare_email": EMAIL}, self.config.cloudflare_credentials) self.assertRaises(errors.PluginError, self.auth.perform, [self.achall])
def test_invalid_algorithm_raises(self): config = VALID_CONFIG.copy() config["rfc2136_algorithm"] = "INVALID" dns_test_common.write(config, self.config.rfc2136_credentials) self.assertRaises(errors.PluginError, self.auth.perform, [self.achall])
def test_invalid_server_raises(self): config = VALID_CONFIG.copy() config["rfc2136_server"] = "example.com" dns_test_common.write(config, self.config.rfc2136_credentials) self.assertRaises(errors.PluginError, self.auth.perform, [self.achall])
def test_valid_file(self): path = os.path.join(self.tempdir, 'too-permissive-file.ini') dns_test_common.write({"test": "value", "other": 1}, path) credentials_configuration = dns_common.CredentialsConfiguration(path) self.assertEqual("value", credentials_configuration.conf("test")) self.assertEqual("1", credentials_configuration.conf("other"))
def test_configure_credentials(self): path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"fake_test": "value"}, path) setattr(self.config, "fake_credentials", path) credentials = self.auth._configure_credentials("credentials", "", {"test": ""}) self.assertEqual(credentials.conf("test"), "value")
def test_configure_credentials(self): path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"fake_test": "value"}, path) setattr(self.config, "fake_credentials", path) credentials = self.auth._configure_credentials("credentials", "", {"test": ""}) self.assertEqual(credentials.conf("test"), "value")
def test_api_version_error(self): path = os.path.join(self.tempdir, 'file_version_error.ini') dns_test_common.write({"linode_key": TOKEN_V3, "linode_version": 5}, path) config = mock.MagicMock(linode_credentials=path, linode_propagation_seconds=0) auth = Authenticator(config, "linode") auth._setup_credentials() self.assertRaises(errors.PluginError, auth._get_linode_client)
def test_api_version_4_detection(self): path = os.path.join(self.tempdir, 'file_4_auto.ini') dns_test_common.write({"linode_key": TOKEN_V4}, path) config = mock.MagicMock(linode_credentials=path, linode_propagation_seconds=0) auth = Authenticator(config, "linode") auth._setup_credentials() client = auth._get_linode_client() self.assertEqual(4, client.api_version)
def test_manual(self): path = os.path.join(self.tempdir, 'file_manual.ini') dns_test_common.write({"dreamhost_key": TOKEN}, path) config = mock.MagicMock(dreamhost_credentials=path, dreamhost_propagation_seconds=0) auth = Authenticator(config, "dreamhost") auth._setup_credentials() client = auth._get_dreamhost_client() self.assertIsNotNone(client)
def test_api_version_4_manual(self): path = os.path.join(self.tempdir, 'file_4_manual.ini') dns_test_common.write({"linode_key": TOKEN_V3, "linode_version": 4}, path) config = mock.MagicMock(linode_credentials=path, linode_propagation_seconds=0) auth = Authenticator(config, "linode") auth._setup_credentials() client = auth._get_linode_client() self.assertEqual(4, client.api_version)
def test_valid_server_passes(self, unused_mock_get_utility): config = VALID_CONFIG.copy() dns_test_common.write(config, self.config.rfc2136_credentials) self.auth.perform([self.achall]) config["rfc2136_server"] = "2001:db8:3333:4444:cccc:dddd:eeee:ffff" dns_test_common.write(config, self.config.rfc2136_credentials) self.auth.perform([self.achall])
def test_api_version_error(self): path = os.path.join(self.tempdir, 'file_version_error.ini') dns_test_common.write({ "linode_key": TOKEN_V3, "linode_version": 5 }, path) config = mock.MagicMock(linode_credentials=path, linode_propagation_seconds=0) auth = Authenticator(config, "linode") auth._setup_credentials() self.assertRaises(errors.PluginError, auth._get_linode_client)
def test_config_missing_zone_info(self): # Test missing mapping list dns_test_common.write( { 'azure_sp_client_id': '912ce44a-0156-4669-ae22-c16a17d34ca5', 'azure_sp_client_secret': 'E-xqXU83Y-jzTI6xe9fs2YC~mck3ZzUih9', 'azure_tenant_id': 'ed1090f3-ab18-4b12-816c-599af8a88cf7', }, self.sp_config.azure_config) with self.assertRaises(errors.PluginError) as cm: self.auth.perform(SINGLE_DOMAIN) self.assertIn('At least one zone mapping needs to be provided', cm.exception.args[0])
def setUp(self): from certbot_dns_azure._internal.dns_azure import Authenticator super(AuthenticatorTest, self).setUp() # Setup config files config_files = (('sp.ini', { 'azure_sp_client_id': '912ce44a-0156-4669-ae22-c16a17d34ca5', 'azure_sp_client_secret': 'E-xqXU83Y-jzTI6xe9fs2YC~mck3ZzUih9', 'azure_tenant_id': 'ed1090f3-ab18-4b12-816c-599af8a88cf7', 'azure_zone1': 'example.com:/subscriptions/c135abce-d87d-48df-936c-15596c6968a5/resourceGroups/dns1', 'azure_zone2': 'example.org:/subscriptions/99800903-fb14-4992-9aff-12eaf2744622/resourceGroups/dns2' }), ('user_assigned_msi.ini', { 'azure_msi_client_id': '912ce44a-0156-4669-ae22-c16a17d34ca5', 'azure_zone1': 'example.com:/subscriptions/c135abce-d87d-48df-936c-15596c6968a5/resourceGroups/dns1', 'azure_zone2': 'example.org:/subscriptions/99800903-fb14-4992-9aff-12eaf2744622/resourceGroups/dns2' }), ('system_msi.ini', { 'azure_msi_system_assigned': 'true', 'azure_zone1': 'example.com:/subscriptions/c135abce-d87d-48df-936c-15596c6968a5/resourceGroups/dns1', 'azure_zone2': 'example.org:/subscriptions/99800903-fb14-4992-9aff-12eaf2744622/resourceGroups/dns2' })) for file, config in config_files: dns_test_common.write(config, os.path.join(self.tempdir, file)) self.sp_config = mock.MagicMock(azure_config=os.path.join( self.tempdir, 'sp.ini'), azure_propagation_seconds=0) self.umsi_config = mock.MagicMock(azure_config=os.path.join( self.tempdir, 'user_assigned_msi.ini'), azure_propagation_seconds=0) self.smsi_config = mock.MagicMock(azure_config=os.path.join( self.tempdir, 'system_msi.ini'), azure_propagation_seconds=0) self.auth = Authenticator(self.sp_config, "azure") self.mock_credentials = mock.MagicMock() self.mock_client = mock.MagicMock() self.auth._get_azure_credentials = mock.MagicMock( return_value=self.mock_credentials) self.auth._get_azure_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"linode_key": TOKEN}, path) self.config = mock.MagicMock(linode_credentials=path, linode_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "linode") self.mock_client = mock.MagicMock() # _get_linode_client | pylint: disable=protected-access self.auth._get_linode_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_luadns._internal.dns_luadns import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"luadns_email": EMAIL, "luadns_token": TOKEN}, path) self.config = mock.MagicMock(luadns_credentials=path, luadns_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "luadns") self.mock_client = mock.MagicMock() # _get_luadns_client | pylint: disable=protected-access self.auth._get_luadns_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): from certbot_dns_digitalocean.dns_digitalocean import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"digitalocean_token": TOKEN}, path) self.config = mock.MagicMock(digitalocean_credentials=path, digitalocean_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "digitalocean") self.mock_client = mock.MagicMock() # _get_digitalocean_client | pylint: disable=protected-access self.auth._get_digitalocean_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_luadns.dns_luadns import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"luadns_email": EMAIL, "luadns_token": TOKEN}, path) self.config = mock.MagicMock(luadns_credentials=path, luadns_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "luadns") self.mock_client = mock.MagicMock() # _get_luadns_client | pylint: disable=protected-access self.auth._get_luadns_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): from certbot_dns_beget._internal.dns_beget import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write(VALID_CONFIG, path) self.config = mock.MagicMock(beget_credentials=path, beget_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "beget") self.mock_client = mock.MagicMock() # _get_beget_client | pylint: disable=protected-access self.auth._get_beget_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): from certbot_dns_rfc2136.dns_rfc2136 import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write(VALID_CONFIG, path) self.config = mock.MagicMock(rfc2136_credentials=path, rfc2136_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "rfc2136") self.mock_client = mock.MagicMock() # _get_rfc2136_client | pylint: disable=protected-access self.auth._get_rfc2136_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_cloudxns.dns_cloudxns import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"cloudxns_api_key": API_KEY, "cloudxns_secret_key": SECRET}, path) self.config = mock.MagicMock(cloudxns_credentials=path, cloudxns_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "cloudxns") self.mock_client = mock.MagicMock() # _get_cloudxns_client | pylint: disable=protected-access self.auth._get_cloudxns_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_verifier.dns_verifier import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"verifier_api_id": API_ID, "verifier_api_token": API_TOKEN}, path) self.config = mock.MagicMock(verifier_credentials=path, verifier_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "verifier") self.mock_client = mock.MagicMock() # _get_dnsimple_client | pylint: disable=protected-access self.auth._get_dns_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"linode_key": TOKEN}, path) self.config = mock.MagicMock( linode_credentials=path, linode_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "linode") self.mock_client = mock.MagicMock() # _get_linode_client | pylint: disable=protected-access self.auth._get_linode_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): from certbot_dns_digitalocean._internal.dns_digitalocean import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"digitalocean_token": TOKEN}, path) self.config = mock.MagicMock(digitalocean_credentials=path, digitalocean_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "digitalocean") self.mock_client = mock.MagicMock() # _get_digitalocean_client | pylint: disable=protected-access self.auth._get_digitalocean_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): from certbot_dns_cloudflare._internal.dns_cloudflare import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"cloudflare_email": EMAIL, "cloudflare_api_key": API_KEY}, path) self.config = mock.MagicMock(cloudflare_credentials=path, cloudflare_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "cloudflare") self.mock_client = mock.MagicMock() # _get_cloudflare_client | pylint: disable=protected-access self.auth._get_cloudflare_client = mock.MagicMock(return_value=self.mock_client)
def test_prompt_credentials(self, mock_get_utility): bad_path = os.path.join(self.tempdir, 'bad-file.ini') dns_test_common.write({"fake_other": "other_value"}, bad_path) path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"fake_test": "value"}, path) setattr(self.config, "fake_credentials", "") mock_display = mock_get_utility() mock_display.directory_select.side_effect = ((display_util.OK, "",), (display_util.OK, "not-a-file.ini",), (display_util.OK, self.tempdir), (display_util.OK, bad_path), (display_util.OK, path,)) credentials = self.auth._configure_credentials("credentials", "", {"test": ""}) self.assertEqual(credentials.conf("test"), "value")
def test_prompt_credentials(self, mock_get_utility): bad_path = os.path.join(self.tempdir, 'bad-file.ini') dns_test_common.write({"fake_other": "other_value"}, bad_path) path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"fake_test": "value"}, path) setattr(self.config, "fake_credentials", "") mock_display = mock_get_utility() mock_display.directory_select.side_effect = ((display_util.OK, "",), (display_util.OK, "not-a-file.ini",), (display_util.OK, self.tempdir), (display_util.OK, bad_path), (display_util.OK, path,)) credentials = self.auth._configure_credentials("credentials", "", {"test": ""}) self.assertEqual(credentials.conf("test"), "value")
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_rackspace.dns_rackspace import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({"rackspace_username": USERNAME, "rackspace_apiKey": APIKEY, \ "rackspace_account_id": ACCOUNT_ID}, path) self.config = mock.MagicMock(rackspace_credentials=path, rackspace_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "rackspace") self.mock_client = mock.MagicMock() # _get_rackspace_client | pylint: disable=protected-access self.auth._get_rackspace_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): from certbot_1cloud.dns import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, '1cloud.ini') dns_test_common.write({'1cloud_token': TOKEN}, path) k = { '1cloud_credentials': path, '1cloud_propagation_seconds': 0 } self.config = mock.MagicMock(**k) self.auth = Authenticator(self.config, '1cloud') self.mock_client = mock.MagicMock() self.auth._get_1cloud_client = mock.MagicMock( return_value=self.mock_client)
def setUp(self): from certbot_dns_dnspod.dns_dnspod import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, "file.ini") dns_test_common.write( { "dnspod_email": EMAIL, "dnspod_api_token": API_TOKEN }, path) self.config = mock.MagicMock( dnspod_credentials=path, dnspod_propagation_seconds=0 # don"t wait during tests ) self.auth = Authenticator(self.config, "dnspod") self.mock_client = mock.MagicMock() # _get_cloudflare_client | pylint: disable=protected-access self.auth.dnspod = self.mock_client
def setUp(self): from certbot_dns_schlundtech.dns_schlundtech import Authenticator super(AuthenticatorTest, self).setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write({ "dns_schlundtech_user": USER, "dns_schlundtech_password": PASSWORD, "dns_schlundtech_context": CONTEXT }, path) self.config = mock.MagicMock(dns_schlundtech_credentials=path, dns_schlundtech_propagation_seconds=0) self.auth = Authenticator(self.config, "dns-schlundtech") self.mock_client = mock.MagicMock() # _get_gateway_client | pylint: disable=protected-access self.auth._get_gateway_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_sakuracloud.dns_sakuracloud import Authenticator path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write( {"sakuracloud_api_token": API_TOKEN, "sakuracloud_api_secret": API_SECRET}, path ) self.config = mock.MagicMock(sakuracloud_credentials=path, sakuracloud_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "sakuracloud") self.mock_client = mock.MagicMock() # _get_sakuracloud_client | pylint: disable=protected-access self.auth._get_sakuracloud_client = mock.MagicMock(return_value=self.mock_client)
def setUp(self): super(AuthenticatorTest, self).setUp() from certbot_dns_ovh.dns_ovh import Authenticator path = os.path.join(self.tempdir, 'file.ini') credentials = { "ovh_endpoint": ENDPOINT, "ovh_application_key": APPLICATION_KEY, "ovh_application_secret": APPLICATION_SECRET, "ovh_consumer_key": CONSUMER_KEY, } dns_test_common.write(credentials, path) self.config = mock.MagicMock(ovh_credentials=path, ovh_propagation_seconds=0) # don't wait during tests self.auth = Authenticator(self.config, "ovh") self.mock_client = mock.MagicMock() # _get_ovh_client | pylint: disable=protected-access self.auth._get_ovh_client = mock.MagicMock(return_value=self.mock_client)
def _write(self, values): dns_test_common.write(values, self.path)
def test_valid_algorithm_passes(self): config = VALID_CONFIG.copy() config["rfc2136_algorithm"] = "HMAC-sha512" dns_test_common.write(config, self.config.rfc2136_credentials) self.auth.perform([self.achall])