예제 #1
0
 def testEnds(self):
     cc = Chaincode([0, 0], "2460") # Can I test more than one path? How?
     end = [0, 0]
     self.assertTrue(cc.matchend(end))
예제 #2
0
 def testEndsFalse(self):
     cc = Chaincode([0, 0], "24460")
     end = [0, 0]
     self.failIf(cc.matchend(end))
예제 #3
0
 def testSubBoundingBoxY(self):
     cc = Chaincode([0, 0], "44464660012075602223")
     self.failUnless(cc.subBoundingBox(yedge=[-1, 0.5]) == [0, 3])
예제 #4
0
 def testScaleSecond(self):
     cc = Chaincode([0, 0], "0723", xdelta=0.5, ydelta=0.5)
     second = [-1, 0.5]
     self.failUnless(cc.matchany(second, 2))
예제 #5
0
 def testnparray(self):
     # Let's test that the shape of the array matches the expected
     # To do so we need to use np.array, instead of lists.
     cc = Chaincode([0, 0], "2460")
     shape = (2, 5)
     self.failUnless(cc.coordinates.shape == shape)
예제 #6
0
 def testBoundingBoxFalse(self):
     cc = Chaincode([0, 0], "002")
     boundingbox = [[-1, 0], [-1, 0]]
     self.failIf(np.all(cc.BoundingBox() != np.array(boundingbox)))
예제 #7
0
 def testSecondCoordinate(self):
     cc = Chaincode([0, 0], "0023")
     second = [-2, 0]
     self.assertTrue(cc.matchany(second, 2))
예제 #8
0
 def testScaleSecond(self):
     cc = Chaincode([0, 0], "0723", xdelta=0.5, ydelta=0.5)
     second = [-1, 0.5]
     self.failUnless(cc.matchany(second, 2))
예제 #9
0
 def testEnds(self):
     cc = Chaincode([0, 0], "2460")  # Can I test more than one path? How?
     end = [0, 0]
     self.assertTrue(cc.matchend(end))
예제 #10
0
 def testEndsFalse(self):
     cc = Chaincode([0, 0], "24460")
     end = [0, 0]
     self.assertFalse(cc.matchend(end))
예제 #11
0
 def testScaleSecond(self):
     cc = Chaincode([0, 0], "0723", xdelta=0.5, ydelta=0.5)
     second = [-1, 0.5]
     self.assertTrue(cc.matchany(second, 2))
예제 #12
0
 def testSecondCoordinate(self):
     cc = Chaincode([0, 0], "0023")
     second = [-2, 0]
     self.assertTrue(cc.matchany(second, 2))
예제 #13
0
 def testEnds(self):
     cc = Chaincode([0, 0], "2460") # Can I test more than one path? How?
     end = [0, 0]
     self.failUnless(cc.matchend(end))
예제 #14
0
 def testSecondCoordinate(self):
     cc = Chaincode([0, 0], "0023")
     second = [-2, 0]
     self.failUnless(cc.matchany(second, 2))
예제 #15
0
 def testSecondCoordinateFails(self):
     cc = Chaincode([1, 0], "0023")
     second = [-2, 0]
     self.assertFalse(cc.matchany(second, 2))
예제 #16
0
 def testSecondCoordinateFails(self):
     cc = Chaincode([1, 0], "0023")
     second = [-2, 0]
     self.failIf(cc.matchany(second, 2))
예제 #17
0
 def testScaleSecond(self):
     cc = Chaincode([0, 0], "0723", xdelta=0.5, ydelta=0.5)
     second = [-1, 0.5]
     self.assertTrue(cc.matchany(second, 2))
예제 #18
0
 def testScaleEnd(self):
     cc = Chaincode([1.2, 3], "0723", xdelta=2.629, ydelta=2.629)
     end = [-1.429, 0.371]
     self.failUnless(cc.matchany(end, -1))
예제 #19
0
 def testScaleEnd(self):
     cc = Chaincode([1.2, 3],"0723", xdelta=2.629, ydelta=2.629)
     end = [-1.429, 0.371]
     self.assertTrue(cc.matchany(end, -1))
예제 #20
0
 def testBoundingBox(self):  #needs of np.array... I think
     cc = Chaincode([0, 0], "00033344")
     boundingbox = [[-3, 2], [-3, 0]]  # [[x0,x1],[y0,y1]] (like cc)
     self.failUnless(np.all(cc.BoundingBox() == np.array(boundingbox)))
예제 #21
0
 def testSubBoundingBoxX(self):
     cc = Chaincode([0, 0], "44464660012075602223")
     self.assertTrue(cc.subBoundingBox(xedge=[0.1, 2]) == [0, 3])
예제 #22
0
 def testSubBoundingBoxX(self):
     cc = Chaincode([0, 0], "44464660012075602223")
     self.failUnless(cc.subBoundingBox(xedge=[0.1, 2]) == [0, 3])
예제 #23
0
 def testSubBoundingBoxY(self):
     cc = Chaincode([0, 0], "44464660012075602223")
     self.assertTrue(cc.subBoundingBox(yedge=[-1, 0.5]) == [0, 3])
예제 #24
0
 def testEnds(self):
     cc = Chaincode([0, 0], "2460")  # Can I test more than one path? How?
     end = [0, 0]
     self.failUnless(cc.matchend(end))
예제 #25
0
 def testSecondCoordinate(self):
     cc = Chaincode([0, 0], "0023")
     second = [-2, 0]
     self.failUnless(cc.matchany(second, 2))