def test_guidelineIndex(self): font = Font(getTestFontPath()) guideline1 = Guideline(guidelineDict={"x": 100}) guideline2 = Guideline(guidelineDict={"y": 200}) font.guidelines = [guideline1, guideline2] self.assertEqual(font.guidelineIndex(guideline1), 0) self.assertEqual(font.guidelineIndex(guideline2), 1)
def test_removeGuideline(self): font = Font(getTestFontPath()) guideline1 = Guideline(guidelineDict={"x": 100}) guideline2 = Guideline(guidelineDict={"y": 200}) font.guidelines = [guideline1, guideline2] font.removeGuideline(guideline1) self.assertEqual(font.guidelines, [guideline2])
def test_clearGuidelines(self): font = Font(getTestFontPath()) guideline1 = Guideline(guidelineDict={"x": 100}) guideline2 = Guideline(guidelineDict={"y": 200}) font.guidelines = [guideline1, guideline2] self.assertEqual(font.guidelines, [guideline1, guideline2]) font.clearGuidelines() self.assertEqual(font.guidelines, [])