Browse Source

Additional test on compile_commands for deletion

pull/360/head
Rhosyn Celyn 7 years ago
parent
commit
402f645acd
1 changed files with 30 additions and 0 deletions
  1. +30
    -0
      tests/test_octodns_provider_mythicbeasts.py

+ 30
- 0
tests/test_octodns_provider_mythicbeasts.py View File

@ -229,6 +229,36 @@ class TestMythicBeastsProvider(TestCase):
expected_commands
)
# Now test deletion
existing = 'prawf-txt 300 TXT prawf prawf dyma prawf\n' \
'prawf-a 60 A 1.2.3.4'
with requests_mock() as mock:
mock.post(ANY, status_code=200, text=existing)
wanted = Zone('unit.tests.', [])
plan = provider.plan(wanted)
changes = plan.changes
generated_commands = []
for change in changes:
generated_commands.extend(
provider._compile_commands('DELETE', change.existing)
)
expected_commands = [
'DELETE prawf-a.unit.tests 60 A 1.2.3.4',
'DELETE prawf-txt.unit.tests 300 TXT prawf prawf dyma prawf',
]
generated_commands.sort()
expected_commands.sort()
self.assertEquals(
generated_commands,
expected_commands
)
def test_fake_command_generation(self):
class FakeChangeRecord(object):
def __init__(self):


Loading…
Cancel
Save