Browse Source

Merge pull request #872 from octodns/more-cname-tests

Test that CNAME does not allow url and fqdn w/path
pull/873/head
Ross McFarland 4 years ago
committed by GitHub
parent
commit
1e0a190697
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      tests/test_octodns_record.py

+ 20
- 0
tests/test_octodns_record.py View File

@ -2281,6 +2281,26 @@ class TestRecordValidation(TestCase):
self.assertEqual(['CNAME value "foo.bar.com" missing trailing .'], self.assertEqual(['CNAME value "foo.bar.com" missing trailing .'],
ctx.exception.reasons) ctx.exception.reasons)
# doesn't allow urls
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, 'www', {
'type': 'CNAME',
'ttl': 600,
'value': 'https://google.com',
})
self.assertEqual(['CNAME value "https://google.com" is not a valid '
'FQDN'], ctx.exception.reasons)
# doesn't allow paths
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, 'www', {
'type': 'CNAME',
'ttl': 600,
'value': 'google.com/some/path',
})
self.assertEqual(['CNAME value "google.com/some/path" is not a valid '
'FQDN'], ctx.exception.reasons)
def test_DNAME(self): def test_DNAME(self):
# A valid DNAME record. # A valid DNAME record.
Record.new(self.zone, 'sub', { Record.new(self.zone, 'sub', {


Loading…
Cancel
Save