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())
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())
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)
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())
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())
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)
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)
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)
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)
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)
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)