test_output_settings.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/python
  2. import sys
  3. import os
  4. import tempfile
  5. import shutil
  6. import unittest
  7. from lvcgui import MVCGui
  8. import datafiles
  9. import devices
  10. data = datafiles.TestData()
  11. class Test_Custom_Settings(unittest.TestCase):
  12. """Features: users can specify custom format, size and aspect ration.
  13. """
  14. def setUp(self):
  15. """
  16. Each tests assumes that I there are files in the list ready to be
  17. converted to some format.
  18. """
  19. self.lvc = MVCGui()
  20. self.lvc.lvc_focus()
  21. print("starting test: ", self.shortDescription())
  22. datadir, testfiles = data.test_data(many=True)
  23. self.lvc.browse_for_files(datadir, testfiles)
  24. self.output_dir = tempfile.mkdtemp()
  25. self.lvc.choose_save_location(self.output_dir)
  26. def choose_custom_size(self):
  27. """Scenario: Choose custom size.
  28. When I enter a custom size option
  29. Then the conversion uses that setting."""
  30. lvc = MVCGui()
  31. _, testfiles = data.test_data()
  32. item = testfiles[0]
  33. w = '360'
  34. h = '180'
  35. lvc.choose_custom_size(self, 'on', width=w, height=h)
  36. lvc.lvc.choose_device_conversion('WebM')
  37. lvc.start_conversions()
  38. assert lvc.verify_size(item, width=w, height=h)
  39. def choose_aspect_ration(self):
  40. """Scenario: Choose a device, then choose a custom aspect ratio.
  41. Given I choose a device option
  42. When I set the "aspect ratio"
  43. Then I'm not really sure what will happen
  44. """
  45. self.fail('need to know how to test this')
  46. def choose_device_then_change_size(self):
  47. """Scenario: Choose a device, then choose a custom size.
  48. When I choose a device
  49. And I change size
  50. Then the selected size is used in the conversion
  51. """
  52. lvc = MVCGui()
  53. _, testfiles = data.test_data()
  54. item = testfiles[0]
  55. w = '240'
  56. h = '180'
  57. lvc.choose_device_conversion('Galaxy Tab')
  58. lvc.choose_custom_size(self, 'on', width=w, height=h)
  59. lvc.start_conversions()
  60. assert lvc.verify_size(item, width=w, height=h)