Beispiel #1
0
 def test_add_rest_returns_no_space_when_measure_is_full(self):
     measure = 1
     length = 2
     return_value1 = score_service.add_rest(measure, length)
     return_value2 = score_service.add_rest(measure, length)
     return_value3 = score_service.add_rest(measure, length)
     self.assertEqual(return_value1, True)
     self.assertEqual(return_value2, True)
     self.assertEqual(return_value3, "No space")
Beispiel #2
0
 def _handle_add_rest(self, measure, length):
   self._update_error_label()
   try:
     is_success = score_service.add_rest(measure, length)
     if is_success == True:
       self._update_score_view((int(measure) - 1) / score_service.get_staff_length())
     elif is_success == 'No space':
       self._error_label.grid(row=0, column=8)
   except:
     pass
Beispiel #3
0
 def test_add_rest_returns_false_with_invalid_measure(self):
     measure = -1
     length = 4
     return_value = score_service.add_rest(measure, length)
     self.assertEqual(return_value, False)
Beispiel #4
0
 def test_add_rest_returns_true_with_valid_parameters(self):
     measure = 2
     length = 4
     return_value = score_service.add_rest(measure, length)
     self.assertEqual(return_value, True)