diff options
| author | Bob Halley <halley@dnspython.org> | 2020-08-26 06:49:56 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-08-26 06:49:56 -0700 |
| commit | 2c6441960608635772d9ebca26c657113cee3eea (patch) | |
| tree | 6da66498d4eabbbe517f3386e27e627b9bd5e1a6 /tests | |
| parent | b4826fb2d890b6ab6936425ed0cb89379b5d5bd9 (diff) | |
| download | dnspython-2c6441960608635772d9ebca26c657113cee3eea.tar.gz | |
use classmethod for Gateway factories
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_rdata.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/tests/test_rdata.py b/tests/test_rdata.py index 956bec0..72ed15a 100644 --- a/tests/test_rdata.py +++ b/tests/test_rdata.py @@ -642,29 +642,18 @@ class RdataTestCase(unittest.TestCase): class UtilTestCase(unittest.TestCase): def test_Gateway_bad_type0(self): - g = dns.rdtypes.util.Gateway(0, 'bad.') with self.assertRaises(SyntaxError): - g.check() + dns.rdtypes.util.Gateway(0, 'bad.') def test_Gateway_bad_type3(self): - g = dns.rdtypes.util.Gateway(3, 'bad.') with self.assertRaises(SyntaxError): - g.check() + dns.rdtypes.util.Gateway(3, 'bad.') def test_Gateway_type4(self): - g = dns.rdtypes.util.Gateway(4) with self.assertRaises(SyntaxError): - g.check() - with self.assertRaises(ValueError): - g.to_text() - with self.assertRaises(dns.exception.SyntaxError): - tok = dns.tokenizer.Tokenizer('bogus') - g.from_text(tok) - with self.assertRaises(ValueError): - f = io.BytesIO() - g.to_wire(f) + dns.rdtypes.util.Gateway(4) with self.assertRaises(dns.exception.FormError): - g.from_wire_parser(None) + dns.rdtypes.util.Gateway.from_wire_parser(4, None) def test_Bitmap(self): b = dns.rdtypes.util.Bitmap |
