MCPcopy Create free account
hub / github.com/rthalley/dnspython / test_section_count_update

Method test_section_count_update

tests/test_message.py:1027–1046  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1025 self.assertEqual(a.section_count(dns.message.MessageSection.ADDITIONAL), 3)
1026
1027 def test_section_count_update(self):
1028 update = dns.update.Update("example")
1029 update.id = 1
1030 # These each add 1 record to the prereq section
1031 update.present("foo")
1032 update.present("foo", "a")
1033 update.present("bar", "a", "10.0.0.5")
1034 update.absent("blaz2")
1035 update.absent("blaz2", "a")
1036 # This adds 3 records to the update section
1037 update.replace("foo", 300, "a", "10.0.0.1", "10.0.0.2")
1038 # These each add 1 record to the update section
1039 update.add("bar", dns.rdataset.from_text(1, 1, 300, "10.0.0.3"))
1040 update.delete("bar", "a", "10.0.0.4")
1041 update.delete("blaz", "a")
1042 update.delete("blaz2")
1043
1044 self.assertEqual(update.section_count(dns.update.UpdateSection.ZONE), 1)
1045 self.assertEqual(update.section_count(dns.update.UpdateSection.PREREQ), 5)
1046 self.assertEqual(update.section_count(dns.update.UpdateSection.UPDATE), 7)
1047
1048 def test_extended_errors(self):
1049 options = [

Callers

nothing calls this directly

Calls 7

presentMethod · 0.80
absentMethod · 0.80
section_countMethod · 0.80
replaceMethod · 0.45
addMethod · 0.45
from_textMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected