(zone)
| 301 | |
| 302 | |
| 303 | def test_explicit_rollback_and_commit(zone): |
| 304 | with zone.writer() as txn: |
| 305 | assert not txn.changed() |
| 306 | txn.delete(dns.name.from_text("bar.foo", None)) |
| 307 | txn.rollback() |
| 308 | assert zone.get_node("bar.foo") is not None |
| 309 | with zone.writer() as txn: |
| 310 | assert not txn.changed() |
| 311 | txn.delete(dns.name.from_text("bar.foo", None)) |
| 312 | txn.commit() |
| 313 | assert zone.get_node("bar.foo") is None |
| 314 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 315 | with zone.writer() as txn: |
| 316 | txn.rollback() |
| 317 | txn.delete(dns.name.from_text("bar.foo", None)) |
| 318 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 319 | with zone.writer() as txn: |
| 320 | txn.rollback() |
| 321 | txn.add("bar.foo", 300, dns.rdata.from_text("in", "txt", "hi")) |
| 322 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 323 | with zone.writer() as txn: |
| 324 | txn.rollback() |
| 325 | txn.replace("bar.foo", 300, dns.rdata.from_text("in", "txt", "hi")) |
| 326 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 327 | with zone.reader() as txn: |
| 328 | txn.rollback() |
| 329 | txn.get("bar.foo", "in", "mx") |
| 330 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 331 | with zone.writer() as txn: |
| 332 | txn.rollback() |
| 333 | txn.delete_exact("bar.foo") |
| 334 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 335 | with zone.writer() as txn: |
| 336 | txn.rollback() |
| 337 | txn.name_exists("bar.foo") |
| 338 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 339 | with zone.writer() as txn: |
| 340 | txn.rollback() |
| 341 | txn.update_serial() |
| 342 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 343 | with zone.writer() as txn: |
| 344 | txn.rollback() |
| 345 | txn.changed() |
| 346 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 347 | with zone.writer() as txn: |
| 348 | txn.rollback() |
| 349 | txn.rollback() |
| 350 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 351 | with zone.writer() as txn: |
| 352 | txn.rollback() |
| 353 | txn.commit() |
| 354 | with pytest.raises(dns.transaction.AlreadyEnded): |
| 355 | with zone.writer() as txn: |
| 356 | txn.rollback() |
| 357 | for rdataset in txn: |
| 358 | pass |
| 359 | |
| 360 |
nothing calls this directly
no test coverage detected
searching dependent graphs…