Skip to content

Commit 144aa9d

Browse files
committed
Test new exception
1 parent 07547f3 commit 144aa9d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/reader_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ def test_ipv6_address_in_ipv4_database(self):
9494
reader.get('2001::')
9595
reader.close()
9696

97+
def test_no_extension_exception(self):
98+
real_extension = maxminddb.extension
99+
maxminddb.extension = None
100+
with self.assertRaisesRegex(ImportError, 'MODE_MMAP_EXT requires the maxminddb.extension module to be available'):
101+
open_database(
102+
'tests/data/test-data/MaxMind-DB-test-decoder.mmdb', MODE_MMAP_EXT)
103+
maxminddb.extension = real_extension
104+
97105
def test_broken_database(self):
98106
reader = open_database('tests/data/test-data/'
99107
'GeoIP2-City-Test-Broken-Double-Format.mmdb',

0 commit comments

Comments
 (0)