pvl.hosts.zone: test forward= omit
authorTero Marttila <tero.marttila@aalto.fi>
Wed, 25 Feb 2015 14:54:24 +0200
changeset 465 133f14810eb5
parent 464 f1d3dbf04ca3
child 466 ad9d512ec1e7
pvl.hosts.zone: test forward= omit
pvl/hosts/tests.py
--- a/pvl/hosts/tests.py	Wed Feb 25 14:52:53 2015 +0200
+++ b/pvl/hosts/tests.py	Wed Feb 25 14:54:24 2015 +0200
@@ -140,17 +140,26 @@
         self.assertZoneEquals((rr for ip, rr in zone.host_reverse(h, ipaddr.IPNetwork('2001:db8::/64'))), {
             ('1.0.2.0.0.0.0.c.0.0.0.0.0.0.0.0', 'PTR'): ['host.domain.'],
         })
+    
+    def testHostDelegateForward(self):
+        h = host.Host.build('host', 'example.com',
+                forward = 'host.example.net',
+        )
+
+        self.assertZoneEquals(zone.host_forward(h, 'example.com'), {
+            ('host', 'CNAME'): ['host.example.net.'],
+        })
 
     def testHostDelegate(self):
         h = host.Host.build('host', 'example.com',
                 ip      = '192.0.2.1',
                 ip6     = '2001:db8::192.0.2.1',
-                forward = 'host.example.net',
+                forward = '',
                 reverse = '1.0/28.2.0.192.in-addr.arpa',
         )
 
         self.assertZoneEquals(zone.host_forward(h, 'example.com'), {
-            ('host', 'CNAME'): ['host.example.net.'],
+
         })
 
         self.assertZoneEquals((rr for ip, rr in zone.host_reverse(h, ipaddr.IPNetwork('192.0.2.1/24'))), {