def test_TSIG(self): keyring = dns.tsigkeyring.from_text( {'keyname.': 'NjHwPsMKjdN++dOfE5iAiQ=='}) update = dns.update.Update('example.', keyring=keyring) update.replace('host.example.', 300, 'A', '1.2.3.4') wire = update.to_wire() update2 = dns.message.from_wire(wire, keyring) self.assertEqual(update, update2)
def test_TSIG(self): keyring = dns.tsigkeyring.from_text( {"keyname.": "NjHwPsMKjdN++dOfE5iAiQ=="}) update = dns.update.Update("example.", keyring=keyring) update.replace("host.example.", 300, "A", "1.2.3.4") wire = update.to_wire() update2 = dns.message.from_wire(wire, keyring) self.assertEqual(update, update2)
def test_to_wire3(self): update = dns.update.Update('example') update.id = 1 update.present('foo') update.present('foo', 'a') update.present('bar', 'a', '10.0.0.5') update.absent('blaz2') update.absent('blaz2', 'a') update.replace('foo', 300, 'a', '10.0.0.1', '10.0.0.2') update.add('bar', dns.rdataset.from_text(1, 1, 300, '10.0.0.3')) update.delete('bar', 'a', '10.0.0.4') update.delete('blaz', 'a') update.delete('blaz2') self.failUnless(update.to_wire() == goodwire)
def test_to_wire3(self): # type: () -> None update = dns.update.Update('example') update.id = 1 update.present('foo') update.present('foo', 'a') update.present('bar', 'a', '10.0.0.5') update.absent('blaz2') update.absent('blaz2', 'a') update.replace('foo', 300, 'a', '10.0.0.1', '10.0.0.2') update.add('bar', dns.rdataset.from_text(1, 1, 300, '10.0.0.3')) update.delete('bar', 'a', '10.0.0.4') update.delete('blaz', 'a') update.delete('blaz2') self.assertEqual(update.to_wire(), goodwire)
def test_to_wire2(self): # type: () -> None update = dns.update.Update('example') update.id = 1 update.present('foo') update.present('foo', 'a') update.present('bar', 'a', '10.0.0.5') update.absent('blaz2') update.absent('blaz2', 'a') update.replace('foo', 300, 'a', '10.0.0.1', '10.0.0.2') update.add('bar', 300, dns.rdata.from_text(1, 1, '10.0.0.3')) update.delete('bar', 'a', '10.0.0.4') update.delete('blaz', 'a') update.delete('blaz2') self.failUnless(update.to_wire() == goodwire)
def test_to_wire3(self): # type: () -> None update = dns.update.Update("example") update.id = 1 update.present("foo") update.present("foo", "a") update.present("bar", "a", "10.0.0.5") update.absent("blaz2") update.absent("blaz2", "a") update.replace("foo", 300, "a", "10.0.0.1", "10.0.0.2") update.add("bar", dns.rdataset.from_text(1, 1, 300, "10.0.0.3")) update.delete("bar", "a", "10.0.0.4") update.delete("blaz", "a") update.delete("blaz2") self.assertEqual(update.to_wire(), goodwire)
def test_to_wire1(self): update = dns.update.Update('example') update.id = 1 update.present('foo') update.present('foo', 'a') update.present('bar', 'a', '10.0.0.5') update.absent('blaz2') update.absent('blaz2', 'a') update.replace('foo', 300, 'a', '10.0.0.1', '10.0.0.2') update.add('bar', 300, 'a', '10.0.0.3') update.delete('bar', 'a', '10.0.0.4') update.delete('blaz', 'a') update.delete('blaz2') self.failUnless(update.to_wire() == goodwire)
def test_to_wire1(self): # type: () -> None update = dns.update.Update('example') update.id = 1 update.present('foo') update.present('foo', 'a') update.present('bar', 'a', '10.0.0.5') update.absent('blaz2') update.absent('blaz2', 'a') update.replace('foo', 300, 'a', '10.0.0.1', '10.0.0.2') update.add('bar', 300, 'a', '10.0.0.3') update.delete('bar', 'a', '10.0.0.4') update.delete('blaz', 'a') update.delete('blaz2') self.failUnless(update.to_wire() == goodwire)
def test_to_wire1(self): # type: () -> None update = dns.update.Update('example') update.id = 1 update.present('foo') update.present('foo', 'a') update.present('bar', 'a', '10.0.0.5') update.absent('blaz2') update.absent('blaz2', 'a') update.replace('foo', 300, 'a', '10.0.0.1', '10.0.0.2') update.add('bar', 300, 'a', '10.0.0.3') update.delete('bar', 'a', '10.0.0.4') update.delete('blaz', 'a') update.delete('blaz2') self.assertTrue(update.to_wire() == goodwire)
def test_from_text1(self): update = dns.message.from_text(update_text) w = update.to_wire(origin=dns.name.from_text('example'), want_shuffle=False) self.failUnless(w == goodwire)
def test_from_text1(self): # type: () -> None update = dns.message.from_text(update_text) self.assertTrue(isinstance(update, dns.update.UpdateMessage)) w = update.to_wire(origin=dns.name.from_text('example'), want_shuffle=False) self.assertEqual(w, goodwire)
def test_from_text1(self): # type: () -> None update = dns.message.from_text(update_text) w = update.to_wire(origin=dns.name.from_text('example'), want_shuffle=False) self.failUnless(w == goodwire)