Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_normalizeFontInfoPlist_guidelines_angle_horizontal(self):
guideline = dict(x=1, y=2, angle=0)
expected = dict(y=2)
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_no_angle(self):
guideline = dict(x=1, y=2, name="test", color="1,0,0,.5",
identifier="TEST")
expected = None
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_no_identifier(self):
guideline = dict(x=1, y=2, angle=3, name="test", color="1,0,0,.5")
expected = dict(x=1, y=2, angle=3, name="test", color="1,0,0,0.5")
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_no_identifier(self):
guideline = dict(x=1, y=2, angle=3, name="test", color="1,0,0,.5")
expected = dict(x=1, y=2, angle=3, name="test", color="1,0,0,0.5")
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_no_y(self):
guideline = dict(x=1, name="test", color="1,0,0,.5", identifier="TEST")
expected = dict(x=1, name="test", color="1,0,0,0.5", identifier="TEST")
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
guideline = dict(x=1, angle=3, name="test", color="1,0,0,.5",
identifier="TEST")
expected = None
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_invalid_x(self):
guideline = dict(x="invalid", y=2, angle=3, name="test",
color="1,0,0,.5", identifier="TEST")
expected = None
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_invalid_y(self):
guideline = dict(x=1, y="invalid", angle=3, name="test",
color="1,0,0,.5", identifier="TEST")
expected = None
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_no_color(self):
guideline = dict(x=1, y=2, angle=3, name="test", identifier="TEST")
expected = dict(x=1, y=2, angle=3, name="test", identifier="TEST")
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_invalid_x(self):
guideline = dict(x="invalid", y=2, angle=3, name="test",
color="1,0,0,.5", identifier="TEST")
expected = None
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)
def test_normalizeFontInfoPlist_guidelines_everything(self):
guideline = dict(x=1, y=2, angle=3, name="test", color="1,0,0,.5",
identifier="TEST")
expected = dict(x=1, y=2, angle=3, name="test", color="1,0,0,0.5",
identifier="TEST")
result = _normalizeDictGuideline(guideline)
self.assertEqual(result, expected)