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