def testSingletonTupleRaises(self): with self.assertRaises(ValueError): features._to_point((32, ))
def testThreeTupleRaises(self): with self.assertRaises(ValueError): features._to_point((32, 32, 32))
def testNoneAsSecondElementOfTupleRaises(self): with self.assertRaises(TypeError): features._to_point((32, None))
def testNoneAsFirstElementOfTupleRaises(self): with self.assertRaises(TypeError): features._to_point((None, 32))
def testNoneInputReturnsNoneOutput(self): with self.assertRaises(AssertionError): features._to_point(None)
def testIntStringTwoTuple(self): value = features._to_point(("32", 64)) self.assertEqual(value, point.Point(32, 64))
def testIntAsString(self): value = features._to_point("32") self.assertEqual(value, point.Point(32, 32))