diff options
| author | Bob Halley <halley@dnspython.org> | 2020-08-16 17:58:29 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-08-21 07:40:45 -0700 |
| commit | a7de0230bcbd9eb1a92cebe988394231cd6437da (patch) | |
| tree | 80eaac1c15eda312309c0d87f904a19a55fafc1c /tests/test_transaction.py | |
| parent | e2888f116e0c98748f63044e9801acd0d18defd5 (diff) | |
| download | dnspython-xfr.tar.gz | |
Implement new inbound xfr design.xfr
Diffstat (limited to 'tests/test_transaction.py')
| -rw-r--r-- | tests/test_transaction.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_transaction.py b/tests/test_transaction.py index 7fb353c..bb69b71 100644 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -13,6 +13,7 @@ import dns.transaction import dns.versioned import dns.zone + class DB(dns.transaction.TransactionManager): def __init__(self): self.rdatasets = {} @@ -24,7 +25,7 @@ class DB(dns.transaction.TransactionManager): return Transaction(self, replacement, False) def origin_information(self): - return (None, True) + return (dns.name.from_text('example'), True, dns.name.empty) def get_class(self): return dns.rdataclass.IN @@ -224,6 +225,13 @@ def test_bad_parameters(db): with pytest.raises(TypeError): txn.delete(1) +def test_cannot_store_non_origin_soa(db): + with pytest.raises(ValueError): + with db.writer() as txn: + rrset = dns.rrset.from_text('foo', 300, 'in', 'SOA', + '. . 1 2 3 4 5') + txn.add(rrset) + example_text = """$TTL 3600 $ORIGIN example. @ soa foo bar 1 2 3 4 5 |
