def __str__(self):
# get ratio
ratio = int(round(16.0*self.height/self.width))
- if ratio == 12: # 16:12 = 4:3
+ if ratio == 11: # 16:10.66 = 3:2
+ strRatio = "3:2"
+ elif ratio == 12: # 16:12 = 4:3
strRatio = '4:3'
elif ratio == 13: # 16:12.8 = 5:4
strRatio = '5:4'
self.assertEqual(str(screen.Resolution(1366, 768)), '1366x768 (16:9)')
self.assertEqual(str(screen.Resolution(1920, 1080)), '1920x1080 (16:9)')
self.assertEqual(str(screen.Resolution(1920, 1200)), '1920x1200 (16:10)')
+ self.assertEqual(str(screen.Resolution(720, 480)), '720x480 (3:2)')
if __name__ == '__main__':
unittest.main()