Browse Source

Delete second ns1 record to make sure cache clears w/o zone

pull/760/head
Ross McFarland 4 years ago
parent
commit
56b8b23391
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
1 changed files with 19 additions and 3 deletions
  1. +19
    -3
      tests/test_octodns_provider_ns1.py

+ 19
- 3
tests/test_octodns_provider_ns1.py View File

@ -2615,6 +2615,24 @@ class TestNs1Client(TestCase):
'sub.unit.tests': 'bar', 'sub.unit.tests': 'bar',
}, client._zones_cache) }, client._zones_cache)
# Delete the other record, no zone this time, record should still go
# away
reset()
record_delete_mock.side_effect = [{}]
self.assertEquals({}, client.records_delete('unit.tests',
'a.unit.tests', 'A'))
record_delete_mock.assert_has_calls([call('unit.tests', 'a.unit.tests',
'A')])
self.assertEquals({
'unit.tests': {
'a.unit.tests': {},
'aaaa.unit.tests': {},
}
}, client._records_cache)
self.assertEquals({
'sub.unit.tests': 'bar',
}, client._zones_cache)
# Record update removes zone and caches result # Record update removes zone and caches result
record_update_mock.side_effect = ['done'] record_update_mock.side_effect = ['done']
self.assertEquals('done', client.records_update('sub.unit.tests', self.assertEquals('done', client.records_update('sub.unit.tests',
@ -2625,9 +2643,7 @@ class TestNs1Client(TestCase):
'AAAA', key='val')]) 'AAAA', key='val')])
self.assertEquals({ self.assertEquals({
'unit.tests': { 'unit.tests': {
'a.unit.tests': {
'A': 'baz'
},
'a.unit.tests': {},
'aaaa.unit.tests': {}, 'aaaa.unit.tests': {},
}, },
'sub.unit.tests': { 'sub.unit.tests': {


Loading…
Cancel
Save