コード例 #1
0
	def test_invalid_poly(self):
		invalid_polys = [[(0, 0), (1, 0), (0, 0)],
							[(0, 0), (1, 0), (1, 1), (0.5, 1), (0.5, 0), (0, 0)],
							[(0, 0), (1, 0), (1, 1), (0, 0), (-1, 0), (0, -1), (0, 0)],
							[(-1, 0), (1, 0), (0, 1), (0, -1), (-1, 0)]]
		for poly in invalid_polys:
			self.assertFalse(isValid(poly))
コード例 #2
0
	def test_valid_poly(self):
		valid_polys = [[(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)], 
						[(-10.2, -6), (0, 0), (1, -3), (1, -7), (0, -4), (-10.2, -6)]]
		for poly in valid_polys:
			self.assertTrue(isValid(poly))