Added extra check for return value to test_create_txt_record

This commit is contained in:
Kush Bavishi 2019-08-07 13:55:02 -07:00
parent fa7f71d859
commit b4f4e4dc24
1 changed files with 2 additions and 1 deletions

View File

@ -380,6 +380,7 @@ class TestAcme(unittest.TestCase):
zone = "test.example.com" zone = "test.example.com"
token = "ABCDEFGHIJ" token = "ABCDEFGHIJ"
account_number = "1234567890" account_number = "1234567890"
change_id = (domain, token)
ultradns.get_zone_name = Mock(return_value=zone) ultradns.get_zone_name = Mock(return_value=zone)
mock_current_app.logger.debug = Mock() mock_current_app.logger.debug = Mock()
ultradns._post = Mock() ultradns._post = Mock()
@ -390,8 +391,8 @@ class TestAcme(unittest.TestCase):
"message": "TXT record created" "message": "TXT record created"
} }
result = ultradns.create_txt_record(domain, token, account_number) result = ultradns.create_txt_record(domain, token, account_number)
# TODO: check change_id
mock_current_app.logger.debug.assert_called_with(log_data) mock_current_app.logger.debug.assert_called_with(log_data)
self.assertEqual(result, change_id)
@patch("lemur.plugins.lemur_acme.ultradns.current_app") @patch("lemur.plugins.lemur_acme.ultradns.current_app")
@patch("lemur.extensions.metrics") @patch("lemur.extensions.metrics")