Skip to content

Commit faec324

Browse files
committedJul 25, 2018
Make __repr__ tests actually run
1 parent 5503af8 commit faec324

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed
 

‎tests/src/python/test_python_repr.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,56 +23,56 @@
2323

2424
class TestPython__repr__(unittest.TestCase):
2525

26-
def TestQgsGeometryRepr(self):
26+
def testQgsGeometryRepr(self):
2727
p = QgsPointXY(123.456, 987.654)
2828
g = QgsGeometry.fromPointXY(p)
2929
self.assertTrue(g.__repr__().startswith('<QgsGeometry: Point (123.456)'))
3030

31-
def TestQgsPointRepr(self):
31+
def testQgsPointRepr(self):
3232
p = QgsPoint(123.456, 987.654, 100)
3333
self.assertTrue(p.__repr__().startswith('<QgsPoint: PointZ (123.456)'))
3434

35-
def TestQgsPointXYRepr(self):
35+
def testQgsPointXYRepr(self):
3636
p = QgsPointXY(123.456, 987.654)
3737
self.assertTrue(p.__repr__().startswith('<QgsPointXY: POINT(123.456'))
3838

39-
def TestQgsCircleRepr(self):
39+
def testQgsCircleRepr(self):
4040
c = QgsCircle(QgsPoint(1, 1), 2.0)
4141
self.assertEqual(c.__repr__(), '<QgsCircle: Circle (Center: Point (1 1), Radius: 2, Azimuth: 0)>')
4242

43-
def TestQgsCircularstringRepr(self):
43+
def testQgsCircularstringRepr(self):
4444
cs = QgsCircularString(QgsPoint(1, 2), QgsPoint(2, 3), QgsPoint(3, 4))
4545
self.assertEqual(cs.__repr__(), '<QgsCompoundCurve: CompoundCurve (CircularString (1 2, 2 3, 3 4))>')
4646

47-
def TestQgsCompoundcurveRepr(self):
47+
def testQgsCompoundcurveRepr(self):
4848
cs = QgsCircularString(QgsPoint(1, 2), QgsPoint(2, 3), QgsPoint(3, 4))
4949
cc = QgsCompoundCurve()
5050
cc.addCurve(cs)
5151
self.assertEqual(cc.__repr__(), '<QgsCompoundCurve: CompoundCurve (CircularString (1 2, 2 3, 3 4))>')
5252

53-
def TestQgsCurvepolygonRepr(self):
53+
def testQgsCurvepolygonRepr(self):
5454
cp = QgsCurvePolygon()
5555
cs = QgsCircularString(QgsPoint(1, 10), QgsPoint(2, 11), QgsPoint(1, 10))
5656
cp.setExteriorRing(cs)
5757
self.assertEqual(cp.__repr__(), '<QgsCurvePolygon: CurvePolygon (CircularString (1 10, 2 11, 1 10))>')
5858

59-
def TestQgsEllipseRepr(self):
59+
def testQgsEllipseRepr(self):
6060
e = QgsEllipse(QgsPoint(1, 2), 2.0, 3.0)
6161
self.assertEqual(e.__repr__(), '<QgsEllipse: Ellipse (Center: Point (1 2), Semi-Major Axis: 3, Semi-Minor Axis: 2, Azimuth: 180)>')
6262

63-
def TestQgsLineStringRepr(self):
63+
def testQgsLineStringRepr(self):
6464
ls = QgsLineString([QgsPoint(10, 2), QgsPoint(10, 1), QgsPoint(5, 1)])
6565
self.assertEqual(ls.__repr__(), '<QgsLineString: LineString (10 2, 10 1, 5 1)>')
6666

67-
def TestQgsMulticurveRepr(self):
67+
def testQgsMulticurveRepr(self):
6868
mc = QgsMultiCurve()
6969
cs = QgsCircularString(QgsPoint(1, 10), QgsPoint(2, 11), QgsPoint(3, 12))
7070
mc.addGeometry(cs)
7171
cs2 = QgsCircularString(QgsPoint(4, 20), QgsPoint(5, 22), QgsPoint(6, 24))
7272
mc.addGeometry(cs2)
7373
self.assertEqual(mc.__repr__(), '<QgsMulitCurve: MultiCurve (CircularString (1 10, 2 11, 3 12),CircularString (4 20, 5 22, 6 24))>')
7474

75-
def TestQgsMultilineStringRepr(self):
75+
def testQgsMultilineStringRepr(self):
7676
ml = QgsGeometry.fromMultiPolylineXY(
7777
[
7878
[QgsPointXY(0, 0), QgsPointXY(1, 0), QgsPointXY(1, 1), QgsPointXY(2, 1), QgsPointXY(2, 0), ],
@@ -81,12 +81,12 @@ def TestQgsMultilineStringRepr(self):
8181
)
8282
self.assertEqual(ml.constGet().__repr__(), '<QgsMultiLineString: MultiLineString ((0 0, 1 0, 1 1, 2 1, 2 0),(3 0, 3 1, 5 1, 5 0, 6 0))>')
8383

84-
def TestQgsMultiPointRepr(self):
84+
def testQgsMultiPointRepr(self):
8585
wkt = "MultiPoint ((10 30),(40 20),(30 10),(20 10))"
8686
mp = QgsGeometry.fromWkt(wkt)
8787
self.assertEqual(mp.constGet().__repr__(), '<QgsMultiPoint: MultiPoint ((10 30),(40 20),(30 10),(20 10))>')
8888

89-
def TestQgsMultipolygonRepr(self):
89+
def testQgsMultipolygonRepr(self):
9090
mp = QgsGeometry.fromMultiPolygonXY([
9191
[[QgsPointXY(1, 1),
9292
QgsPointXY(2, 2),
@@ -99,7 +99,7 @@ def TestQgsMultipolygonRepr(self):
9999
])
100100
self.assertEqual(mp.constGet().__repr__(), '<QgsMultiPolygon: MultiPolygon (((1 1, 2 2, 1 2, 1 1)),((2 2, 3 3, 3 1, 2 2)))>')
101101

102-
def TestQgsPolygonRepr(self):
102+
def testQgsPolygonRepr(self):
103103
p = QgsGeometry.fromPolygonXY(
104104
[[QgsPointXY(0, 0),
105105
QgsPointXY(2, 0),
@@ -108,7 +108,7 @@ def TestQgsPolygonRepr(self):
108108
QgsPointXY(0, 0)]])
109109
self.assertEqual(p.constGet().__repr__(), '<QgsPolygon: Polygon ((0 0, 2 0, 2 2, 0 2, 0 0))>')
110110

111-
def TestQgsRectangleRepr(self):
111+
def testQgsRectangleRepr(self):
112112
r = QgsRectangle(1, 2, 3, 4)
113113
self.assertEqual(r.constGet().__repr__(), '<QgsRectangle: 1 2, 3 4>')
114114

0 commit comments

Comments
 (0)
Please sign in to comment.