示例#1
0
 def test_ui_increase_minimum(self):
     low, high = self.stretch.values()
     minimum = self.stretch.minimum()
     delta = low - minimum
     value = minimum + delta / 2
     QTest.keyClicks(self.stretch.minSpinBox, str(value))
     self.assertEqual(self.stretch.minimum(), value)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(high, self.stretch.high())
示例#2
0
 def test_ui_increase_maximum(self):
     low, high = self.stretch.values()
     maximum = self.stretch.maximum()
     delta = 1000 * max(abs(maximum), 1)
     value = maximum + delta
     QTest.keyClicks(self.stretch.maxSpinBox, str(value))
     self.assertEqual(self.stretch.maximum(), value)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(high, self.stretch.high())
示例#3
0
 def test_ui_increase_minimum(self):
     low, high = self.stretch.values()
     minimum = self.stretch.minimum()
     delta = low - minimum
     value = minimum + delta / 2
     QTest.keyClicks(self.stretch.minSpinBox, str(value))
     self.assertEqual(self.stretch.minimum(), value)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(high, self.stretch.high())
示例#4
0
 def test_ui_decrease_maximum_below_high(self):
     low, high = self.stretch.values()
     maximum = 0.5 * (low + high)
     self.assertGreater(maximum, low)
     self.assertLess(maximum, high)
     QTest.keyClicks(self.stretch.maxSpinBox, str(maximum))
     self.assertEqual(self.stretch.maximum(), maximum)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(self.stretch.high(), maximum)
示例#5
0
 def test_ui_decrease_maximum(self):
     low, high = self.stretch.values()
     maximum = self.stretch.maximum()
     delta = maximum - high
     value = maximum + delta / 2
     QTest.keyClicks(self.stretch.maxSpinBox, str(value))
     self.assertEqual(self.stretch.maximum(), value)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(high, self.stretch.high())
示例#6
0
 def test_ui_increase_minimum_above_low(self):
     low, high = self.stretch.values()
     minimum = 0.5 * (low + high)
     self.assertGreater(minimum, low)
     self.assertLess(minimum, high)
     QTest.keyClicks(self.stretch.minSpinBox, str(minimum))
     self.assertEqual(self.stretch.minimum(), minimum)
     self.assertEqual(self.stretch.low(), minimum)
     self.assertEqual(high, self.stretch.high())
示例#7
0
 def test_ui_increase_minimum_above_low(self):
     low, high = self.stretch.values()
     minimum = 0.5 * (low + high)
     self.assertGreater(minimum, low)
     self.assertLess(minimum, high)
     QTest.keyClicks(self.stretch.minSpinBox, str(minimum))
     self.assertEqual(self.stretch.minimum(), minimum)
     self.assertEqual(self.stretch.low(), minimum)
     self.assertEqual(high, self.stretch.high())
示例#8
0
 def test_ui_decrease_maximum(self):
     low, high = self.stretch.values()
     maximum = self.stretch.maximum()
     delta = maximum - high
     value = maximum + delta / 2
     QTest.keyClicks(self.stretch.maxSpinBox, str(value))
     self.assertEqual(self.stretch.maximum(), value)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(high, self.stretch.high())
示例#9
0
 def test_ui_increase_maximum(self):
     low, high = self.stretch.values()
     maximum = self.stretch.maximum()
     delta = 1000 * max(abs(maximum), 1)
     value = maximum + delta
     QTest.keyClicks(self.stretch.maxSpinBox, str(value))
     self.assertEqual(self.stretch.maximum(), value)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(high, self.stretch.high())
示例#10
0
 def test_ui_decrease_maximum_below_high(self):
     low, high = self.stretch.values()
     maximum = 0.5 * (low + high)
     self.assertGreater(maximum, low)
     self.assertLess(maximum, high)
     QTest.keyClicks(self.stretch.maxSpinBox, str(maximum))
     self.assertEqual(self.stretch.maximum(), maximum)
     self.assertEqual(low, self.stretch.low())
     self.assertEqual(self.stretch.high(), maximum)
示例#11
0
 def test_ui_decrease_maximum_below_low(self):
     low, high = self.stretch.values()
     delta = min(abs(low), abs(high)) / 2
     maximum = low - delta
     self.assertLess(maximum, low)
     self.assertGreater(maximum, self.stretch.minimum())
     QTest.keyClicks(self.stretch.maxSpinBox, str(maximum))
     self.assertEqual(self.stretch.maximum(), maximum)
     self.assertEqual(self.stretch.low(), maximum)
     self.assertEqual(self.stretch.high(), maximum)
示例#12
0
 def test_ui_increase_minimum_above_high(self):
     low, high = self.stretch.values()
     delta = min(abs(low), abs(high)) / 2
     minimum = high + delta
     self.assertGreater(minimum, high)
     self.assertLess(minimum, self.stretch.maximum())
     QTest.keyClicks(self.stretch.minSpinBox, str(minimum))
     self.assertEqual(self.stretch.minimum(), minimum)
     self.assertEqual(self.stretch.low(), minimum)
     self.assertEqual(self.stretch.high(), minimum)
示例#13
0
 def test_ui_decrease_maximum_below_low(self):
     low, high = self.stretch.values()
     delta = min(abs(low), abs(high))/2
     maximum = low - delta
     self.assertLess(maximum, low)
     self.assertGreater(maximum, self.stretch.minimum())
     QTest.keyClicks(self.stretch.maxSpinBox, str(maximum))
     self.assertEqual(self.stretch.maximum(), maximum)
     self.assertEqual(self.stretch.low(), maximum)
     self.assertEqual(self.stretch.high(), maximum)
示例#14
0
 def test_ui_increase_minimum_above_high(self):
     low, high = self.stretch.values()
     delta = min(abs(low), abs(high))/2
     minimum = high + delta
     self.assertGreater(minimum, high)
     self.assertLess(minimum, self.stretch.maximum())
     QTest.keyClicks(self.stretch.minSpinBox, str(minimum))
     self.assertEqual(self.stretch.minimum(), minimum)
     self.assertEqual(self.stretch.low(), minimum)
     self.assertEqual(self.stretch.high(), minimum)
示例#15
0
 def test_ui_decrease_maximum_below_minimum(self):
     delta = max(abs(self.stretch.minimum()),
                 abs(self.stretch.maximum()))
     maximum = self.stretch.minimum() - delta
     QTest.keyClicks(self.stretch.maxSpinBox, str(maximum))
     self.assertEqual(self.stretch.maximum(), maximum)
示例#16
0
 def test_ui_increase_minimum_above_maximum(self):
     delta = max(abs(self.stretch.minimum()),
                 abs(self.stretch.maximum()))
     minimum = self.stretch.maximum() + delta
     QTest.keyClicks(self.stretch.minSpinBox, str(minimum))
     self.assertEqual(self.stretch.minimum(), minimum)
示例#17
0
 def test_ui_decrease_maximum_below_minimum(self):
     delta = max(abs(self.stretch.minimum()), abs(self.stretch.maximum()))
     maximum = self.stretch.minimum() - delta
     QTest.keyClicks(self.stretch.maxSpinBox, str(maximum))
     self.assertEqual(self.stretch.maximum(), maximum)
示例#18
0
 def test_ui_increase_minimum_above_maximum(self):
     delta = max(abs(self.stretch.minimum()), abs(self.stretch.maximum()))
     minimum = self.stretch.maximum() + delta
     QTest.keyClicks(self.stretch.minSpinBox, str(minimum))
     self.assertEqual(self.stretch.minimum(), minimum)