def test_invalid(self): self.assertRaises(common.PrassError, lambda: prass.parse_resolution_string("720")) self.assertRaises(common.PrassError, lambda: prass.parse_resolution_string("1920.1080")) self.assertRaises(common.PrassError, lambda: prass.parse_resolution_string("1963p")) self.assertRaises( common.PrassError, lambda: prass.parse_resolution_string("not a number"))
def test_full_definition(self): self.assertEqual((1280, 720), prass.parse_resolution_string("1280:720")) self.assertEqual((848, 480), prass.parse_resolution_string("848x480"))
def test_templates(self): self.assertEqual((1280, 720), prass.parse_resolution_string("720p")) self.assertEqual((1920, 1080), prass.parse_resolution_string("1080p"))