Exemple #1
0
    def test_clear_finished_conversions(self):
        """Feature: Clear a finished conversions.
 
        Given I have converted a file
        When I clear finished conversions
        Then the file is removed
        """
        mvc = MVCGui()
        _, testfiles = data.test_data(many=True)
        mvc.start_conversions()
        assert mvc.clear_finished_conversions(testfiles)
    def test_send_file_to_itunes(self):
        """Scenario: Send to iTunes.
 
        Given I have "Send to iTunes" checked
        When  I convert the an apple format 
        Then the file is added to my iTunes library
        """
        item = "mp4-0.mp4"
        mvc = MVCGui()
        mvc.choose_device_conversion("iPad")
        mvc.choose_itunes()
        mvc.start_conversions()
        mvc.verify_completed(item, 30)
        assert mvc.verify_itunes(item)
    def test_send_file_to_itunes(self):
        """Scenario: Send to iTunes.
 
        Given I have "Send to iTunes" checked
        When  I convert the an apple format 
        Then the file is added to my iTunes library
        """
        item = "mp4-0.mp4"
        mvc = MVCGui()
        mvc.choose_device_conversion("iPad")
        mvc.choose_itunes()
        mvc.start_conversions()
        mvc.verify_completed(item, 30)
        assert mvc.verify_itunes(item)
Exemple #4
0
    def choose_custom_size(self):
        """Scenario: Choose custom size.

        When I enter a custom size option
        Then the conversion uses that setting."""
        mvc = MVCGui()
        _, testfiles = data.test_data()
        item = testfiles[0]
        w = '360'
        h = '180'

        mvc.choose_custom_size(self, 'on', width=w, height=h)
        mvc.mvc.choose_device_conversion('WebM')
        mvc.start_conversions()
        assert mvc.verify_size(item, width=w, height=h)                
Exemple #5
0
    def choose_device_then_change_size(self):
        """Scenario: Choose a device, then choose a custom size.

        When  I choose a device 
        And I change size
        Then the selected size is used in the conversion
        """
        mvc = MVCGui()
        _, testfiles = data.test_data()
        item = testfiles[0]
        w = '240'
        h = '180'
        mvc.choose_device_conversion('Galaxy Tab')
        mvc.choose_custom_size(self, 'on', width=w, height=h)
        mvc.start_conversions()
        assert mvc.verify_size(item, width=w, height=h) 
Exemple #6
0
    def test_clear_finished_item_with_in_progress(self):
        """Scenario: Clear finished conversions while others are in progress.

        Given I have converted a file
            And I have some conversions in progress
        When I clear finished conversions
        Then the completed files are removed
            And the in-progress conversions remain
        """
        _, testfiles = data.test_data(many=True)
        item = 'slow_conversion.mkv'
        item_dir = data.testfile_attr(item, 'testdir')
        mvc = MVCGui()
        mvc.browse_for_files(item_dir, item)
        mvc.start_conversions()
        mvc.clear_finished_conversions(testfiles)
        assert mvc.verify_converting(item)
Exemple #7
0
    def test_clear_finished_after_conversion_errors(self):
        """Scenario: Clear finished conversions after conversion errors.

           Given I convert several files and 1 that will fail
           When I clear finished conversions
           Then the completed files are removed
             And the failed conversions are removed
        """
        _, testfiles = data.test_data(many=True)
        item = 'fake_video.mp4'
        item_dir = data.testfile_attr(item, 'testdir')
        mvc = MVCGui()
        mvc.browse_for_files(item_dir, item)
        mvc.start_conversions()
        mvc.verify_conversions_finished()
        mvc.clear_and_start_over()
        assert mvc.verify_file_not_in_list(testfiles[0])
        assert mvc.verify_file_not_in_list(item)
def convert_to_format(device_output):
    print device_output
    expected_failures = ['fake_video.mp4']
    mvc = MVCGui()
    mvc.mvc_focus()
    datadir, testfiles = data.test_data(many=True, new=True)
    mvc.browse_for_files(datadir, testfiles)
    output_dir = tempfile.mkdtemp()
    mvc.choose_save_location(output_dir)
    mvc.choose_device_conversion("device_output")
    mvc.start_conversions()
    for item in testfiles:
        if item in expected_failures:
            mvc.verify_failed(item, 120)
        else:
            mvc.verify_completed(item, 120)
        mvc.clear_finished_files(item)
    mvc.clear_and_start_over()