diff options
| author | Thomas Waldmann <tw@waldmann-edv.de> | 2015-02-24 19:49:23 +0100 |
|---|---|---|
| committer | Thomas Waldmann <tw@waldmann-edv.de> | 2015-02-24 19:49:23 +0100 |
| commit | 0f0850f738425fda85b21e04cb72f7ca6f2923c0 (patch) | |
| tree | 421a8965a1fc534fb9b2563655b5cc8d009f20ad /tests/test_tokenizer.py | |
| parent | 43c14fd73b3b94211ff8bfad8f894b48cce4e577 (diff) | |
| download | dnspython-0f0850f738425fda85b21e04cb72f7ca6f2923c0.tar.gz | |
fix unicode ipaddr crashes in rdata.from_text and tokenizer.Tokenizer, fixes #41
also added unit tests for both issues.
Diffstat (limited to 'tests/test_tokenizer.py')
| -rw-r--r-- | tests/test_tokenizer.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_tokenizer.py b/tests/test_tokenizer.py index 1d561ae..d75de3b 100644 --- a/tests/test_tokenizer.py +++ b/tests/test_tokenizer.py @@ -22,6 +22,16 @@ Token = dns.tokenizer.Token class TokenizerTestCase(unittest.TestCase): + def testStr(self): + tok = dns.tokenizer.Tokenizer('foo') + token = tok.get() + self.failUnless(token == Token(dns.tokenizer.IDENTIFIER, 'foo')) + + def testUnicode(self): + tok = dns.tokenizer.Tokenizer(u'foo') + token = tok.get() + self.failUnless(token == Token(dns.tokenizer.IDENTIFIER, 'foo')) + def testQuotedString1(self): tok = dns.tokenizer.Tokenizer(r'"foo"') token = tok.get() |
