Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 12, 2021
1 parent 9d51444 commit e8bb898
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgsvertexid.sip.in
Expand Up @@ -57,7 +57,7 @@ Returns ``True`` if this vertex ID is valid for the specified ``geom``.

SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsVertexId: %1,%2,%3%4>" ).arg( sipCpp->part ).arg( sipCpp->ring ).arg( sipCpp->vertex ).arg( qgsEnumValueToKey( sipCpp->type ) );
QString str = QStringLiteral( "<QgsVertexId: %1,%2,%3 %4>" ).arg( sipCpp->part ).arg( sipCpp->ring ).arg( sipCpp->vertex ).arg( qgsEnumValueToKey( sipCpp->type ) );
sipRes = PyUnicode_FromString( str.toUtf8().data() );
%End

Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsvertexid.h
Expand Up @@ -100,7 +100,7 @@ struct CORE_EXPORT QgsVertexId
#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
QString str = QStringLiteral( "<QgsVertexId: %1,%2,%3%4>" ).arg( sipCpp->part ).arg( sipCpp->ring ).arg( sipCpp->vertex ).arg( qgsEnumValueToKey( sipCpp->type ) );
QString str = QStringLiteral( "<QgsVertexId: %1,%2,%3 %4>" ).arg( sipCpp->part ).arg( sipCpp->ring ).arg( sipCpp->vertex ).arg( qgsEnumValueToKey( sipCpp->type ) );
sipRes = PyUnicode_FromString( str.toUtf8().data() );
% End
#endif
Expand Down
6 changes: 3 additions & 3 deletions tests/src/python/test_python_repr.py
Expand Up @@ -304,11 +304,11 @@ def testQgsProperty(self):

def testQgsVertexId(self):
v = QgsVertexId()
self.assertEqual(v.__repr__(), '<QgsVertexId: -1,-1,-1>')
self.assertEqual(v.__repr__(), '<QgsVertexId: -1,-1,-1 Segment>')
v = QgsVertexId(1, 2, 3)
self.assertEqual(v.__repr__(), '<QgsVertexId: 1,2,3>')
self.assertEqual(v.__repr__(), '<QgsVertexId: 1,2,3 Segment>')
v = QgsVertexId(1, 2, 3, _type=QgsVertexId.CurveVertex)
self.assertEqual(v.__repr__(), '<QgsVertexId: 1,2,3 CurveVertex>')
self.assertEqual(v.__repr__(), '<QgsVertexId: 1,2,3 Curve>')

def testProviderMetadata(self):
self.assertEqual(QgsProviderRegistry.instance().providerMetadata('ogr').__repr__(), '<QgsProviderMetadata: ogr>')
Expand Down

0 comments on commit e8bb898

Please sign in to comment.