Skip to content

Commit

Permalink
Add tests for _SpatialElement.__getattr__
Browse files Browse the repository at this point in the history
  • Loading branch information
Éric Lemoine committed Jun 27, 2019
1 parent a03763f commit 70569d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_elements.py
Expand Up @@ -40,6 +40,10 @@ def test_function_call(self):
u'ST_GeomFromText_2': -1
}

def test_attribute_error(self):
e = WKTElement('POINT(1 2)')
assert not hasattr(e, 'foo')

def test_pickle_unpickle(self):
import pickle
e = WKTElement('POINT(1 2)', srid=3, extended=True)
Expand Down Expand Up @@ -258,6 +262,10 @@ def test_function_call(self):
u'ST_GeomFromWKB_2': -1
}

def test_attribute_error(self):
e = WKBElement(b'\x01\x02')
assert not hasattr(e, 'foo')

def test_function_str(self):
e = WKBElement(b'\x01\x02')
assert isinstance(str(e), str)
Expand Down

0 comments on commit 70569d1

Please sign in to comment.