Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Type tests

  • Loading branch information...
commit b9ff7a77497b84ca7d28de362236db256c98e57e 1 parent 913d347
Saj Goonatilleke authored

Showing 2 changed files with 16 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 tests/test_record.py
  2. +8 0 tests/test_zone.py
9 tests/test_record.py
... ... @@ -1,4 +1,4 @@
1   -from nose.tools import raises, with_setup
  1 +from nose.tools import raises
2 2 import datetime
3 3 import logging
4 4 import pdorclient
@@ -16,6 +16,13 @@ def teardown():
16 16 tests.restore_config()
17 17 tests.nuke_zone()
18 18
  19 +@raises(AssertionError)
  20 +def test_invalid_type():
  21 + pdorclient.Record(name=tests.TEST_DATA_ZONE,
  22 + type=12345, # invalid
  23 + content='ns1.%s' % tests.TEST_DATA_ZONE,
  24 + config=pdorclient.Config(path=tests.TMP_CONFIG))
  25 +
19 26 @raises(pdorclient.errors.PrematurePersistError)
20 27 def test_refuse_to_persist_a_dangling_record():
21 28 record = pdorclient.Record(name=tests.TEST_DATA_ZONE,
8 tests/test_zone.py
@@ -16,6 +16,14 @@ def teardown():
16 16 tests.restore_config()
17 17 tests.nuke_zone()
18 18
  19 +@raises(AssertionError)
  20 +def test_invalid_type():
  21 + pdorclient.Zone(name=tests.TEST_DATA_ZONE,
  22 + type=12345, # invalid
  23 + ttl=tests.TEST_DATA_TTL,
  24 + notes=tests.TEST_DATA_NOTES,
  25 + config=pdorclient.Config(path=tests.TMP_CONFIG))
  26 +
19 27 @raises(pdorclient.errors.Rfc952ViolationError)
20 28 def test_raise_rfc952_violation_on_nonsense_name():
21 29 pdorclient.Zone.lookup('example!com',

0 comments on commit b9ff7a7

Please sign in to comment.
Something went wrong with that request. Please try again.