How to use with_args method in PyHamcrest

Best Python code snippet using PyHamcrest_python

test_school_diary.py

Source:test_school_diary.py Github

copy

Full Screen

...33 def test_add_student_has_length(self):34 self.temp.add_student('Ola', 'Kot', 17)35 assert_that(self.temp.add_student('Jan', 'Kowalski', 12), has_length(2))36 def test_add_student_firstname_object(self):37 assert_that(calling(self.temp.add_student).with_args({}, 'Nowak', 10), raises(TypeError))38 def test_add_student_firstname_array(self):39 assert_that(calling(self.temp.add_student).with_args([], 'Nowak', 10), raises(TypeError))40 def test_add_student_firstname_true(self):41 assert_that(calling(self.temp.add_student).with_args(True, 'Nowak', 10), raises(TypeError))42 def test_add_student_firstname_false(self):43 assert_that(calling(self.temp.add_student).with_args(False, 'Nowak', 10), raises(TypeError))44 def test_add_student_firstname_int(self):45 assert_that(calling(self.temp.add_student).with_args(12, 'Nowak', 10), raises(TypeError))46 def test_add_student_firstname_float(self):47 assert_that(calling(self.temp.add_student).with_args(3.14, 'Nowak', 10), raises(TypeError))48 def test_add_student_firstname_int_negative(self):49 assert_that(calling(self.temp.add_student).with_args(-12, 'Nowak', 10), raises(TypeError))50 def test_add_student_firstname_float_negative(self):51 assert_that(calling(self.temp.add_student).with_args(-2.56, 'Nowak', 10), raises(TypeError))52 def test_add_student_lastname_object(self):53 assert_that(calling(self.temp.add_student).with_args('Marcin', {}, 10), raises(TypeError))54 def test_add_student_lastname_array(self):55 assert_that(calling(self.temp.add_student).with_args('Marcin', [], 10), raises(TypeError))56 def test_add_student_lastname_true(self):57 assert_that(calling(self.temp.add_student).with_args('Marcin', True, 10), raises(TypeError))58 def test_add_student_lastname_false(self):59 assert_that(calling(self.temp.add_student).with_args('Marcin', False, 10), raises(TypeError))60 def test_add_student_lastname_int(self):61 assert_that(calling(self.temp.add_student).with_args('Marcin', 31, 10), raises(TypeError))62 def test_add_student_lastname_float(self):63 assert_that(calling(self.temp.add_student).with_args('Marcin', 2.13, 10), raises(TypeError))64 def test_add_student_lastname_int_negative(self):65 assert_that(calling(self.temp.add_student).with_args('Marcin', -12, 10), raises(TypeError))66 def test_add_student_lastname_float_negative(self):67 assert_that(calling(self.temp.add_student).with_args('Marcin', -2.45, 10), raises(TypeError))68 def test_add_student_age_object(self):69 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', {}), raises(TypeError))70 def test_add_student_age_array(self):71 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', []), raises(TypeError))72 def test_add_student_age_true(self):73 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', True), raises(TypeError))74 def test_add_student_age_false(self):75 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', False), raises(TypeError))76 def test_add_student_age_string(self):77 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', 'abc'), raises(TypeError))78 def test_add_student_age_string_number(self):79 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', '23'), raises(TypeError))80 def test_add_student_age_int_negative(self):81 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', -2), raises(ValueError))82 def test_add_student_age_float_negative(self):83 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', -1.0), raises(TypeError))84 def test_add_student_age_zero(self):85 assert_that(calling(self.temp.add_student).with_args('Marcin', 'Nowak', 0), raises(ValueError))86 # Testy show_students87 def test_show_students(self):88 assert_that(self.temp_with_students.show_students(), equal_to([89 {'firstname': 'Jan', 'lastname': 'Kowalski', 'age': 12},90 {'firstname': 'Ola', 'lastname': 'Kot', 'age': 17}91 ]))92 def test_show_students_has_length(self):93 assert_that(self.temp_with_students.show_students(), has_length(2))94 def test_show_students_2(self):95 assert_that(self.temp.show_students(), equal_to([]))96 # Testy edit_student97 def test_edit_student(self):98 assert_that(self.temp_with_students.edit_student(1, firstname='Marcin', lastname='Nowak', age=10), equal_to({99 'firstname': 'Marcin',100 'lastname': 'Nowak',101 'age': 10102 }))103 def test_edit_student_has_length(self):104 assert_that(self.temp_with_students.edit_student(1, firstname='Marcin', lastname='Nowak', age=10),105 has_length(3))106 def test_edit_student_without_age(self):107 assert_that(self.temp_with_students.edit_student(1, firstname='Marcin', lastname='Nowak'), equal_to({108 'firstname': 'Marcin',109 'lastname': 'Nowak',110 'age': 12111 }))112 def test_edit_student_without_lastname(self):113 assert_that(self.temp_with_students.edit_student(1, firstname='Marcin', age=10), equal_to({114 'firstname': 'Marcin',115 'lastname': 'Kowalski',116 'age': 10117 }))118 def test_edit_student_without_firstname(self):119 assert_that(self.temp_with_students.edit_student(1, lastname='Nowak', age=10), equal_to({120 'firstname': 'Jan',121 'lastname': 'Nowak',122 'age': 10123 }))124 def test_edit_student_without_firstname_lastname(self):125 assert_that(self.temp_with_students.edit_student(1, age=10), equal_to({126 'firstname': 'Jan',127 'lastname': 'Kowalski',128 'age': 10129 }))130 def test_edit_student_without_firstname_age(self):131 assert_that(self.temp_with_students.edit_student(1, lastname='Nowak'), equal_to({132 'firstname': 'Jan',133 'lastname': 'Nowak',134 'age': 12135 }))136 def test_edit_student_without_lastname_age(self):137 assert_that(self.temp_with_students.edit_student(1, firstname='Marcin'), equal_to({138 'firstname': 'Marcin',139 'lastname': 'Kowalski',140 'age': 12141 }))142 def test_edit_student_firstname_object(self):143 assert_that(calling(self.temp_with_students.edit_student).with_args(1, {}, 'Nowak', 10), raises(TypeError))144 def test_edit_student_firstname_array(self):145 assert_that(calling(self.temp_with_students.edit_student).with_args(1, [], 'Nowak', 10), raises(TypeError))146 def test_edit_student_firstname_true(self):147 assert_that(calling(self.temp_with_students.edit_student).with_args(1, True, 'Nowak', 10), raises(TypeError))148 def test_edit_student_firstname_false(self):149 assert_that(calling(self.temp_with_students.edit_student).with_args(1, False, 'Nowak', 10), raises(TypeError))150 def test_edit_student_firstname_int(self):151 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 12, 'Nowak', 10), raises(TypeError))152 def test_edit_student_firstname_float(self):153 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 3.14, 'Nowak', 10), raises(TypeError))154 def test_edit_student_firstname_int_negative(self):155 assert_that(calling(self.temp_with_students.edit_student).with_args(1, -12, 'Nowak', 10), raises(TypeError))156 def test_edit_student_firstname_float_negative(self):157 assert_that(calling(self.temp_with_students.edit_student).with_args(1, -2.56, 'Nowak', 10), raises(TypeError))158 def test_edit_student_lastname_object(self):159 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', {}, 10), raises(TypeError))160 def test_edit_student_lastname_array(self):161 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', [], 10), raises(TypeError))162 def test_edit_student_lastname_true(self):163 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', True, 10), raises(TypeError))164 def test_edit_student_lastname_false(self):165 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', False, 10), raises(TypeError))166 def test_edit_student_lastname_int(self):167 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 31, 10), raises(TypeError))168 def test_edit_student_lastname_float(self):169 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 2.13, 10), raises(TypeError))170 def test_edit_student_lastname_int_negative(self):171 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', -12, 10), raises(TypeError))172 def test_edit_student_lastname_float_negative(self):173 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', -2.45, 10), raises(TypeError))174 def test_edit_student_age_object(self):175 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', {}),176 raises(TypeError))177 def test_edit_student_age_array(self):178 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', []),179 raises(TypeError))180 def test_edit_student_age_true(self):181 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', True),182 raises(TypeError))183 def test_edit_student_age_false(self):184 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', False),185 raises(TypeError))186 def test_edit_student_age_string(self):187 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', 'abc'),188 raises(TypeError))189 def test_edit_student_age_string_number(self):190 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', '23'),191 raises(TypeError))192 def test_edit_student_age_int_negative(self):193 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', -2),194 raises(TypeError))195 def test_edit_student_age_float_negative(self):196 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', -1.0),197 raises(TypeError))198 def test_edit_student_age_zero(self):199 assert_that(calling(self.temp_with_students.edit_student).with_args(1, 'Marcin', 'Nowak', 0), raises(TypeError))200 # Testy delete_student201 def test_delete_student(self):202 assert_that(self.temp_with_students.delete_student(1), equal_to([203 {'firstname': 'Ola', 'lastname': 'Kot', 'age': 17}204 ]))205 def test_delete_student_2(self):206 assert_that(self.temp_with_students.delete_student(2), equal_to([207 {'firstname': 'Jan', 'lastname': 'Kowalski', 'age': 12}208 ]))209 def test_delete_student_3(self):210 self.temp_with_students.delete_student(2)211 assert_that(self.temp_with_students.delete_student(1), equal_to([]))212 def test_delete_student_has_length(self):213 self.temp_with_students.delete_student(2)214 assert_that(self.temp_with_students.delete_student(1), has_length(0))215 def test_delete_student_out_of_range(self):216 assert_that(calling(self.temp_with_students.delete_student).with_args(0), raises(ValueError))217 def test_delete_student_out_of_range_2(self):218 assert_that(calling(self.temp_with_students.delete_student).with_args(3), raises(ValueError))219 def test_delete_student_none(self):220 assert_that(calling(self.temp_with_students.delete_student).with_args(None), raises(TypeError))221 def test_delete_student_object(self):222 assert_that(calling(self.temp_with_students.delete_student).with_args({}), raises(TypeError))223 def test_delete_student_array(self):224 assert_that(calling(self.temp_with_students.delete_student).with_args([]), raises(TypeError))225 def test_delete_student_true(self):226 assert_that(calling(self.temp_with_students.delete_student).with_args(True), raises(TypeError))227 def test_delete_student_false(self):228 assert_that(calling(self.temp_with_students.delete_student).with_args(False), raises(TypeError))229 def test_delete_student_string(self):230 assert_that(calling(self.temp_with_students.delete_student).with_args('abc'), raises(TypeError))231 def test_delete_student_string_number(self):232 assert_that(calling(self.temp_with_students.delete_student).with_args('2'), raises(TypeError))233 def test_delete_student_float(self):234 assert_that(calling(self.temp_with_students.delete_student).with_args(2.15), raises(TypeError))235 def test_delete_student_negative_int(self):236 assert_that(calling(self.temp_with_students.delete_student).with_args(-3), raises(ValueError))237 def test_delete_student_negative_float(self):238 assert_that(calling(self.temp_with_students.delete_student).with_args(-3.45), raises(TypeError))239 # Testy add_subject240 def test_add_subject_to_student(self):241 assert_that(self.temp_with_students.add_subject_to_student(1, 'Polski'), equal_to({242 'firstname': 'Jan',243 'lastname': 'Kowalski',244 'age': 12,245 'subjects': ['Polski']246 }))247 def test_add_subject_to_student_2(self):248 self.temp_with_students.add_subject_to_student(1, 'Matematyka')249 assert_that(self.temp_with_students.add_subject_to_student(1, 'Polski'), equal_to({250 'firstname': 'Jan',251 'lastname': 'Kowalski',252 'age': 12,253 'subjects': ['Matematyka', 'Polski']254 }))255 def test_add_subject_to_student_none_subject_id(self):256 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(None, 'Fizyka'),257 raises(TypeError))258 def test_add_subject_to_student_none_name(self):259 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, None), raises(TypeError))260 def test_add_subject_to_student_none(self):261 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(None, None), raises(TypeError))262 def test_add_subject_to_student_object_subject_id(self):263 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args({}, 'Fizyka'), raises(TypeError))264 def test_add_subject_to_student_object_name(self):265 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, {}), raises(TypeError))266 def test_add_subject_to_student_object(self):267 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args({}, {}), raises(TypeError))268 def test_add_subject_to_student_array_subject_id(self):269 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args([], 'Fizyka'), raises(TypeError))270 def test_add_subject_to_student_array_name(self):271 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, []), raises(TypeError))272 def test_add_subject_to_student_array(self):273 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args([], []), raises(TypeError))274 def test_add_subject_to_student_true_subject_id(self):275 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(True, 'Fizyka'),276 raises(TypeError))277 def test_add_subject_to_student_true_name(self):278 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, True), raises(TypeError))279 def test_add_subject_to_student_true(self):280 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(True, True), raises(TypeError))281 def test_add_subject_to_student_false_subject_id(self):282 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(False, 'Fizyka'),283 raises(TypeError))284 def test_add_subject_to_student_false_name(self):285 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, False), raises(TypeError))286 def test_add_subject_to_student_false(self):287 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(False, False), raises(TypeError))288 def test_add_subject_to_student_string_subject_id(self):289 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args('abc', 'Fizyka'),290 raises(TypeError))291 def test_add_subject_to_student_string_number_subject_id(self):292 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args('3', 'Fizyka'), raises(TypeError))293 def test_add_subject_to_student_int_name(self):294 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, 2), raises(TypeError))295 def test_add_subject_to_student_string_subject_id_int_name(self):296 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args('32a', 5), raises(TypeError))297 def test_add_subject_to_student_float_subject_id(self):298 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(2.15, 'Fizyka'),299 raises(TypeError))300 def test_add_subject_to_student_float_name(self):301 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, 3.87), raises(TypeError))302 def test_add_subject_to_student_float(self):303 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1.32, 4.12), raises(TypeError))304 def test_add_subject_to_student_negative_int_subject_id(self):305 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(-3, 'Fizyka'), raises(ValueError))306 def test_add_subject_to_student_negative_int_name(self):307 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, -1), raises(TypeError))308 def test_add_subject_to_student_negative_int(self):309 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(-2, -9), raises(ValueError))310 def test_add_subject_to_student_negative_float_subject_id(self):311 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(-3.12, 'Fizyka'),312 raises(TypeError))313 def test_add_subject_to_student_negative_float_name(self):314 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(1, -1.55), raises(TypeError))315 def test_add_subject_to_student_negative_float(self):316 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(-2.12, -9.65), raises(TypeError))317 def test_add_subject_to_student_id_out_of_range(self):318 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(0, 'Fizyka'), raises(ValueError))319 def test_add_subject_to_student_id_out_of_range_2(self):320 assert_that(calling(self.temp_with_students.add_subject_to_student).with_args(5, 'Fizyka'), raises(ValueError))321 # Testy get_subjects_from_student322 def test_get_subjects_from_student(self):323 assert_that(self.temp_with_student_with_subject.get_subjects_from_student(1),324 equal_to(['Matematyka', 'Polski']))325 def test_get_subjects_from_student_out_of_range(self):326 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(0),327 raises(ValueError))328 def test_get_subjects_from_student_out_of_range_2(self):329 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(3),330 raises(ValueError))331 def test_get_subjects_from_student_none(self):332 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(None),333 raises(TypeError))334 def test_get_subjects_from_student_object(self):335 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args({}),336 raises(TypeError))337 def test_get_subjects_from_student_array(self):338 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args([]),339 raises(TypeError))340 def test_get_subjects_from_student_true(self):341 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(True),342 raises(TypeError))343 def test_get_subjects_from_student_false(self):344 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(False),345 raises(TypeError))346 def test_get_subjects_from_student_string(self):347 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args('abc'),348 raises(TypeError))349 def test_get_subjects_from_student_string_number(self):350 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args('2'),351 raises(TypeError))352 def test_get_subjects_from_student_float(self):353 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(2.15),354 raises(TypeError))355 def test_get_subjects_from_student_negative_int(self):356 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(-3),357 raises(ValueError))358 def test_get_subjects_from_student_negative_float(self):359 assert_that(calling(self.temp_with_student_with_subject.get_subjects_from_student).with_args(-3.45),360 raises(TypeError))361 # Testy edit_subject_in_student362 def test_edit_subject_in_student(self):363 assert_that(self.temp_with_student_with_subject.edit_subject_in_student(1, 1, 'Fizyka'),364 equal_to(['Fizyka', 'Polski']))365 def test_edit_subject_in_student_2(self):366 assert_that(self.temp_with_student_with_subject.edit_subject_in_student(1, 2, 'Biologia'),367 equal_to(['Matematyka', 'Biologia']))368 def test_edit_subject_in_student_id_out_of_range(self):369 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(0, 1, 'Fizyka'),370 raises(ValueError))371 def test_edit_subject_in_student_id_out_of_range_2(self):372 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(4, 1, 'Fizyka'),373 raises(ValueError))374 def test_edit_subject_in_student_subject_id_out_of_range(self):375 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 0, 'Fizyka'),376 raises(ValueError))377 def test_edit_subject_in_student_subject_id_out_of_range_2(self):378 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 6, 'Fizyka'),379 raises(ValueError))380 def test_edit_subject_in_student_id_none(self):381 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(None, 1, 'Fizyka'),382 raises(TypeError))383 def test_edit_subject_in_student_id_object(self):384 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args({}, 1, 'Fizyka'),385 raises(TypeError))386 def test_edit_subject_in_student_id_array(self):387 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args([], 1, 'Fizyka'),388 raises(TypeError))389 def test_edit_subject_in_student_id_true(self):390 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(True, 1, 'Fizyka'),391 raises(TypeError))392 def test_edit_subject_in_student_id_false(self):393 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(False, 1, 'Fizyka'),394 raises(TypeError))395 def test_edit_subject_in_student_id_string(self):396 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args('abc', 1, 'Fizyka'),397 raises(TypeError))398 def test_edit_subject_in_student_id_string_number(self):399 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args('2', 1, 'Fizyka'),400 raises(TypeError))401 def test_edit_subject_in_student_id_float(self):402 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(2.14, 1, 'Fizyka'),403 raises(TypeError))404 def test_edit_subject_in_student_id_negative_int(self):405 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(-3, 1, 'Fizyka'),406 raises(ValueError))407 def test_edit_subject_in_student_id_negative_float(self):408 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(-2.51, 1, 'Fizyka'),409 raises(TypeError))410 def test_edit_subject_in_student_subject_id_none(self):411 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, None, 'Fizyka'),412 raises(TypeError))413 def test_edit_subject_in_student_subject_id_object(self):414 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, {}, 'Fizyka'),415 raises(TypeError))416 def test_edit_subject_in_student_subject_id_array(self):417 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, [], 'Fizyka'),418 raises(TypeError))419 def test_edit_subject_in_student_subject_id_true(self):420 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, True, 'Fizyka'),421 raises(TypeError))422 def test_edit_subject_in_student_subject_id_false(self):423 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, False, 'Fizyka'),424 raises(TypeError))425 def test_edit_subject_in_student_subject_id_string(self):426 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 'abc', 'Fizyka'),427 raises(TypeError))428 def test_edit_subject_in_student_subject_id_string_number(self):429 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, '3', 'Fizyka'),430 raises(TypeError))431 def test_edit_subject_in_student_subject_id_float(self):432 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 2.14, 'Fizyka'),433 raises(TypeError))434 def test_edit_subject_in_student_subject_id_negative_int(self):435 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, -3, 'Fizyka'),436 raises(ValueError))437 def test_edit_subject_in_student_subject_id_negative_float(self):438 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, -2.51, 'Fizyka'),439 raises(TypeError))440 def test_edit_subject_in_student_name_none(self):441 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, None),442 raises(TypeError))443 def test_edit_subject_in_student_name_object(self):444 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, {}),445 raises(TypeError))446 def test_edit_subject_in_student_name_array(self):447 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, []),448 raises(TypeError))449 def test_edit_subject_in_student_name_true(self):450 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, True),451 raises(TypeError))452 def test_edit_subject_in_student_name_false(self):453 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, False),454 raises(TypeError))455 def test_edit_subject_in_student_name_int(self):456 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, 3),457 raises(TypeError))458 def test_edit_subject_in_student_name_float(self):459 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, 3.14),460 raises(TypeError))461 def test_edit_subject_in_student_name_negative_int(self):462 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, -4),463 raises(TypeError))464 def test_edit_subject_in_student_name_negative_float(self):465 assert_that(calling(self.temp_with_student_with_subject.edit_subject_in_student).with_args(1, 1, -4.11),466 raises(TypeError))467 # Testy delete_subject468 def test_delete_subject_in_student(self):469 assert_that(self.temp_with_student_with_subject.delete_subject_in_student(1, 1), equal_to(['Polski']))470 def test_delete_subject_in_student_2(self):471 assert_that(self.temp_with_student_with_subject.delete_subject_in_student(1, 2), equal_to(['Matematyka']))472 def test_delete_subject_in_student_3(self):473 self.temp_with_student_with_subject.delete_subject_in_student(1, 2)474 assert_that(self.temp_with_student_with_subject.delete_subject_in_student(1, 1), equal_to([]))475 def test_delete_subject_in_student_subject_id_out_of_range(self):476 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(0, 1),477 raises(ValueError))478 def test_delete_subject_in_student_subject_id_out_of_range_2(self):479 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(6, 1),480 raises(ValueError))481 def test_delete_subject_in_student_id_out_of_range(self):482 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, 0),483 raises(ValueError))484 def test_delete_subject_in_student_id_out_of_range_2(self):485 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, 4),486 raises(ValueError))487 def test_delete_subject_in_student_none_subject_id(self):488 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(None, 1),489 raises(TypeError))490 def test_delete_subject_in_student_none_grade_id(self):491 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, None),492 raises(TypeError))493 def test_delete_subject_in_student_none(self):494 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(None, None),495 raises(TypeError))496 def test_delete_subject_in_student_object_subject_id(self):497 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args({}, 1),498 raises(TypeError))499 def test_delete_subject_in_student_object_grade_id(self):500 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, {}),501 raises(TypeError))502 def test_delete_subject_in_student_object(self):503 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args({}, {}),504 raises(TypeError))505 def test_delete_subject_in_student_true_subject_id(self):506 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(True, 1),507 raises(TypeError))508 def test_delete_subject_in_student_true_grade_id(self):509 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, True),510 raises(TypeError))511 def test_delete_subject_in_student_true(self):512 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(True, True),513 raises(TypeError))514 def test_delete_subject_in_student_false_subject_id(self):515 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(False, 1),516 raises(TypeError))517 def test_delete_subject_in_student_false_grade_id(self):518 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, False),519 raises(TypeError))520 def test_delete_subject_in_student_false(self):521 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(False, False),522 raises(TypeError))523 def test_delete_subject_in_student_string_subject_id(self):524 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args('abc', 1),525 raises(TypeError))526 def test_delete_subject_in_student_string_number_subject_id(self):527 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args('2', 1),528 raises(TypeError))529 def test_delete_subject_in_student_string_grade_id(self):530 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(2, 'abc'),531 raises(ValueError))532 def test_delete_subject_in_student_string_number_grade_id(self):533 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(2, '3'),534 raises(ValueError))535 def test_delete_subject_in_student_string(self):536 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args('b2', '3a'),537 raises(TypeError))538 def test_delete_subject_in_student_float_subject_id(self):539 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(2.31, 1),540 raises(TypeError))541 def test_delete_subject_in_student_float_grade_id(self):542 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, 1.67),543 raises(TypeError))544 def test_delete_subject_in_student_float(self):545 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(3.12, 4.33),546 raises(TypeError))547 def test_delete_subject_in_student_negative_int_subject_id(self):548 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(-3, 1),549 raises(ValueError))550 def test_delete_subject_in_student_negative_int_grade_id(self):551 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, -8),552 raises(ValueError))553 def test_delete_subject_in_student_negative_int(self):554 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(-2, -5),555 raises(ValueError))556 def test_delete_subject_in_student_negative_float_subject_id(self):557 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(-2.31, 1),558 raises(TypeError))559 def test_delete_subject_in_student_negative_float_grade_id(self):560 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(1, -1.67),561 raises(TypeError))562 def test_delete_subject_in_student_negative_float(self):563 assert_that(calling(self.temp_with_student_with_subject.delete_subject_in_student).with_args(-3.12, -4.33),564 raises(TypeError))565 # Testy add_grade_in_student_in_subject566 def test_add_grade_in_student_in_subject(self):567 assert_that(self.temp_with_student_with_subject.add_grade_in_student_in_subject(1, 1, 4), equal_to({568 'Matematyka': [4],569 'Polski': []570 }))571 def test_add_grade_in_student_in_subject_2(self):572 assert_that(self.temp_with_student_with_subject.add_grade_in_student_in_subject(1, 2, 1), equal_to({573 'Matematyka': [],574 'Polski': [1]575 }))576 def test_add_grade_in_student_in_subject_3(self):577 self.temp_with_student_with_subject.add_grade_in_student_in_subject(1, 2, 1)578 self.temp_with_student_with_subject.add_grade_in_student_in_subject(1, 2, 4)579 assert_that(self.temp_with_student_with_subject.add_grade_in_student_in_subject(1, 1, 6), equal_to({580 'Matematyka': [6],581 'Polski': [1, 4]582 }))583 def test_add_grade_in_student_in_subject_subject_id_out_of_range(self):584 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(0, 1, 4),585 raises(ValueError))586 def test_add_grade_in_student_in_subject_subject_id_out_of_range_2(self):587 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(6, 1, 4),588 raises(ValueError))589 def test_add_grade_in_student_in_subject_id_out_of_range(self):590 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 0, 4),591 raises(ValueError))592 def test_add_grade_in_student_in_subject_id_out_of_range_2(self):593 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 4, 4),594 raises(ValueError))595 def test_add_grade_in_student_in_subject_grade_out_of_range(self):596 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, -2),597 raises(ValueError))598 def test_add_grade_in_student_in_subject_grade_out_of_range_2(self):599 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, 8),600 raises(ValueError))601 def test_add_grade_in_student_in_subject_subject_id_none(self):602 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(None, 1, 4),603 raises(TypeError))604 def test_add_grade_in_student_in_subject_subject_id_object(self):605 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args({}, 1, 4),606 raises(TypeError))607 def test_add_grade_in_student_in_subject_subject_id_array(self):608 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args([], 1, 4),609 raises(TypeError))610 def test_add_grade_in_student_in_subject_subject_id_true(self):611 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(True, 1, 4),612 raises(TypeError))613 def test_add_grade_in_student_in_subject_subject_id_false(self):614 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(False, 1, 4),615 raises(TypeError))616 def test_add_grade_in_student_in_subject_subject_id_string(self):617 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args('abc', 1, 4),618 raises(TypeError))619 def test_add_grade_in_student_in_subject_subject_id_string_number(self):620 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args('3', 1, 4),621 raises(TypeError))622 def test_add_grade_in_student_in_subject_subject_id_float(self):623 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(2.31, 1, 4),624 raises(TypeError))625 def test_add_grade_in_student_in_subject_subject_id_negative_int(self):626 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(-3, 1, 4),627 raises(ValueError))628 def test_add_grade_in_student_in_subject_subject_id_negative_float(self):629 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(-2.16, 1, 4),630 raises(TypeError))631 def test_add_grade_in_student_in_subject_grade_id_none(self):632 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, None, 4),633 raises(TypeError))634 def test_add_grade_in_student_in_subject_grade_id_object(self):635 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, {}, 4),636 raises(TypeError))637 def test_add_grade_in_student_in_subject_grade_id_array(self):638 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, [], 4),639 raises(TypeError))640 def test_add_grade_in_student_in_subject_grade_id_true(self):641 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, True, 4),642 raises(TypeError))643 def test_add_grade_in_student_in_subject_grade_id_false(self):644 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, False, 4),645 raises(TypeError))646 def test_add_grade_in_student_in_subject_grade_id_string(self):647 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 'abc', 4),648 raises(TypeError))649 def test_add_grade_in_student_in_subject_grade_id_string_number(self):650 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, '3', 4),651 raises(TypeError))652 def test_add_grade_in_student_in_subject_grade_id_float(self):653 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 2.31, 4),654 raises(TypeError))655 def test_add_grade_in_student_in_subject_grade_id_negative_int(self):656 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, -1, 4),657 raises(ValueError))658 def test_add_grade_in_student_in_subject_grade_id_negative_float(self):659 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, -2.16, 4),660 raises(TypeError))661 def test_add_grade_in_student_in_subject_grade_none(self):662 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, None),663 raises(TypeError))664 def test_add_grade_in_student_in_subject_grade_object(self):665 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, {}),666 raises(TypeError))667 def test_add_grade_in_student_in_subject_grade_array(self):668 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, []),669 raises(TypeError))670 def test_add_grade_in_student_in_subject_grade_true(self):671 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, True),672 raises(TypeError))673 def test_add_grade_in_student_in_subject_grade_false(self):674 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, False),675 raises(TypeError))676 def test_add_grade_in_student_in_subject_grade_string(self):677 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, 'abc'),678 raises(TypeError))679 def test_add_grade_in_student_in_subject_grade_string_number(self):680 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, '3'),681 raises(TypeError))682 def test_add_grade_in_student_in_subject_grade_float(self):683 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, 2.31),684 raises(TypeError))685 def test_add_grade_in_student_in_subject_grade_negative_int(self):686 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, -1),687 raises(ValueError))688 def test_add_grade_in_student_in_subject_grade_negative_float(self):689 assert_that(calling(self.temp_with_student_with_subject.add_grade_in_student_in_subject).with_args(1, 1, -2.16),690 raises(TypeError))691 # Testy get_grades_in_student_from_subject692 def test_get_grades_in_student_from_subject(self):693 assert_that(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject(1, 1),694 equal_to([2, 5]))695 def test_get_grades_in_student_from_subject_2(self):696 assert_that(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject(1, 2),697 equal_to([2]))698 def test_get_grades_in_student_from_subject_id_out_of_range(self):699 assert_that(700 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(0, 1),701 raises(ValueError))702 def test_get_grades_in_student_from_subject_id_out_of_range_2(self):703 assert_that(704 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(4, 1),705 raises(ValueError))706 def test_get_grades_in_student_from_subject_none_id(self):707 assert_that(708 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(None,709 1),710 raises(TypeError))711 def test_get_grades_in_student_from_subject_none_subject_id(self):712 assert_that(713 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,714 None),715 raises(TypeError))716 def test_get_grades_in_student_from_subject_none(self):717 assert_that(718 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(None,719 None),720 raises(TypeError))721 def test_get_grades_in_student_from_subject_object_id(self):722 assert_that(723 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args({},724 1),725 raises(TypeError))726 def test_get_grades_in_student_from_subject_object_subject_id(self):727 assert_that(728 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,729 {}),730 raises(TypeError))731 def test_get_grades_in_student_from_subject_object(self):732 assert_that(733 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args({},734 {}),735 raises(TypeError))736 def test_get_grades_in_student_from_subject_true_id(self):737 assert_that(738 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(True,739 1),740 raises(TypeError))741 def test_get_grades_in_student_from_subject_true_subject_id(self):742 assert_that(743 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,744 True),745 raises(TypeError))746 def test_get_grades_in_student_from_subject_true(self):747 assert_that(748 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(True,749 True),750 raises(TypeError))751 def test_get_grades_in_student_from_subject_false_id(self):752 assert_that(753 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(False,754 1),755 raises(TypeError))756 def test_get_grades_in_student_from_subject_false_subject_id(self):757 assert_that(758 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,759 False),760 raises(TypeError))761 def test_get_grades_in_student_from_subject_false(self):762 assert_that(763 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(False,764 False),765 raises(TypeError))766 def test_get_grades_in_student_from_subject_string_id(self):767 assert_that(768 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args('abc',769 1),770 raises(TypeError))771 def test_get_grades_in_student_from_subject_string_number_id(self):772 assert_that(773 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args('2',774 1),775 raises(TypeError))776 def test_get_grades_in_student_from_subject_string_subject_id(self):777 assert_that(778 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(2,779 'abc'),780 raises(ValueError))781 def test_get_grades_in_student_from_subject_string_number_subject_id(self):782 assert_that(783 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(2,784 '3'),785 raises(ValueError))786 def test_get_grades_in_student_from_subject_string(self):787 assert_that(788 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args('b2',789 '3a'),790 raises(TypeError))791 def test_get_grades_in_student_from_subject_float_id(self):792 assert_that(793 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(2.31,794 1),795 raises(TypeError))796 def test_get_grades_in_student_from_subject_float_subject_id(self):797 assert_that(798 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,799 1.67),800 raises(TypeError))801 def test_get_grades_in_student_from_subject_float(self):802 assert_that(803 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(3.12,804 4.33),805 raises(TypeError))806 def test_get_grades_in_student_from_subject_negative_int_id(self):807 assert_that(808 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(-3,809 1),810 raises(ValueError))811 def test_get_grades_in_student_from_subject_negative_int_subject_id(self):812 assert_that(813 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,814 -8),815 raises(ValueError))816 def test_get_grades_in_student_from_subject_negative_int(self):817 assert_that(818 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(-2,819 -5),820 raises(ValueError))821 def test_get_grades_in_student_from_subject_negative_float_id(self):822 assert_that(823 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(-2.31,824 1),825 raises(TypeError))826 def test_get_grades_in_student_from_subject_negative_float_subject_id(self):827 assert_that(828 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(1,829 -1.67),830 raises(TypeError))831 def test_get_grades_in_student_from_subject_negative_float(self):832 assert_that(833 calling(self.temp_with_student_with_subject_with_grades.get_grades_in_student_from_subject).with_args(-3.12,834 -4.33),835 raises(TypeError))836 # Testy edit_grade_in_student_in_subject837 def test_edit_grade_in_student_in_subject(self):838 assert_that(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject(1, 1, 1, 6),839 equal_to([6, 5]))840 def test_edit_grade_in_student_in_subject_2(self):841 assert_that(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject(1, 2, 1, 1),842 equal_to([1]))843 def test_edit_grade_in_student_in_subject_id_out_of_range(self):844 assert_that(845 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(0, 1, 1,846 3),847 raises(ValueError))848 def test_edit_grade_in_student_in_subject_id_out_of_range_2(self):849 assert_that(850 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(4, 1, 1,851 3),852 raises(ValueError))853 def test_edit_grade_in_student_in_subject_subject_id_out_of_range(self):854 assert_that(855 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 0, 1,856 3),857 raises(ValueError))858 def test_edit_grade_in_student_in_subject_subject_id_out_of_range_2(self):859 assert_that(860 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 7, 1,861 3),862 raises(ValueError))863 def test_edit_grade_subject_grade_id_out_of_range(self):864 assert_that(865 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 0,866 3),867 raises(ValueError))868 def test_edit_grade_subject_grade_id_out_of_range_2(self):869 assert_that(870 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 4,871 3),872 raises(ValueError))873 def test_edit_grade_subject_grade_out_of_range(self):874 assert_that(875 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,876 0),877 raises(ValueError))878 def test_edit_grade_subject_grade_out_of_range_2(self):879 assert_that(880 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,881 8),882 raises(ValueError))883 def test_edit_grade_subject_id_none(self):884 assert_that(885 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(None, 1,886 1,887 1),888 raises(TypeError))889 def test_edit_grade_subject_id_object(self):890 assert_that(891 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args({}, 1,892 1,893 1),894 raises(TypeError))895 def test_edit_grade_subject_id_array(self):896 assert_that(897 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args([], 1,898 1,899 1),900 raises(TypeError))901 def test_edit_grade_subject_id_true(self):902 assert_that(903 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(True, 1,904 1,905 1),906 raises(TypeError))907 def test_edit_grade_subject_id_false(self):908 assert_that(909 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(False,910 1, 1,911 1),912 raises(TypeError))913 def test_edit_grade_subject_id_string(self):914 assert_that(915 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args('abc',916 1, 1,917 1),918 raises(TypeError))919 def test_edit_grade_subject_id_string_number(self):920 assert_that(921 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args('3', 1,922 1,923 1),924 raises(TypeError))925 def test_edit_grade_subject_id_float(self):926 assert_that(927 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(2.14, 1,928 1,929 1),930 raises(TypeError))931 def test_edit_grade_subject_id_negative_int(self):932 assert_that(933 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(-3, 1,934 1,935 1),936 raises(ValueError))937 def test_edit_grade_subject_id_negative_float(self):938 assert_that(939 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(-2.81,940 1, 1,941 1),942 raises(TypeError))943 def test_edit_grade_subject_subject_id_none(self):944 assert_that(945 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, None,946 1,947 1),948 raises(TypeError))949 def test_edit_grade_subject_subject_id_object(self):950 assert_that(951 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, {},952 1,953 1),954 raises(TypeError))955 def test_edit_grade_subject_subject_id_array(self):956 assert_that(957 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, [],958 1,959 1),960 raises(TypeError))961 def test_edit_grade_subject_subject_id_true(self):962 assert_that(963 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, True,964 1,965 1),966 raises(TypeError))967 def test_edit_grade_subject_subject_id_false(self):968 assert_that(969 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1,970 False,971 1,972 1),973 raises(TypeError))974 def test_edit_grade_subject_subject_id_string(self):975 assert_that(976 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1,977 'abc',978 1,979 1),980 raises(TypeError))981 def test_edit_grade_subject_subject_id_string_number(self):982 assert_that(983 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, '3',984 1,985 1),986 raises(TypeError))987 def test_edit_grade_subject_subject_id_float(self):988 assert_that(989 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 2.14,990 1,991 1),992 raises(TypeError))993 def test_edit_grade_subject_subject_id_negative_int(self):994 assert_that(995 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, -3,996 1,997 1),998 raises(ValueError))999 def test_edit_grade_subject_subject_id_negative_float(self):1000 assert_that(1001 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1,1002 -2.81,1003 1,1004 1),1005 raises(TypeError))1006 def test_edit_grade_subject_grade_id_none(self):1007 assert_that(1008 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1009 None,1010 1),1011 raises(TypeError))1012 def test_edit_grade_subject_grade_id_object(self):1013 assert_that(1014 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1015 {},1016 1),1017 raises(TypeError))1018 def test_edit_grade_subject_grade_id_array(self):1019 assert_that(1020 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1021 [],1022 1),1023 raises(TypeError))1024 def test_edit_grade_subject_grade_id_true(self):1025 assert_that(1026 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1027 True,1028 1),1029 raises(TypeError))1030 def test_edit_grade_subject_grade_id_false(self):1031 assert_that(1032 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1033 False,1034 1),1035 raises(TypeError))1036 def test_edit_grade_subject_grade_id_string(self):1037 assert_that(1038 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1039 'abc',1040 1),1041 raises(TypeError))1042 def test_edit_grade_subject_grade_id_string_number(self):1043 assert_that(1044 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1045 '3',1046 1),1047 raises(TypeError))1048 def test_edit_grade_subject_grade_id_float(self):1049 assert_that(1050 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1051 2.14,1052 1),1053 raises(TypeError))1054 def test_edit_grade_subject_grade_id_negative_int(self):1055 assert_that(1056 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1057 -3,1058 1),1059 raises(ValueError))1060 def test_edit_grade_subject_grade_id_negative_float(self):1061 assert_that(1062 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1,1063 -3.76,1064 1),1065 raises(TypeError))1066 def test_edit_grade_subject_grade_none(self):1067 assert_that(1068 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1069 None),1070 raises(TypeError))1071 def test_edit_grade_subject_grade_object(self):1072 assert_that(1073 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1074 {}),1075 raises(TypeError))1076 def test_edit_grade_subject_grade_array(self):1077 assert_that(1078 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1079 []),1080 raises(TypeError))1081 def test_edit_grade_subject_grade_true(self):1082 assert_that(1083 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1084 True),1085 raises(TypeError))1086 def test_edit_grade_subject_grade_false(self):1087 assert_that(1088 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1089 False),1090 raises(TypeError))1091 def test_edit_grade_subject_grade_string(self):1092 assert_that(1093 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1094 'abc'),1095 raises(TypeError))1096 def test_edit_grade_subject_grade_string_number(self):1097 assert_that(1098 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1099 '2'),1100 raises(TypeError))1101 def test_edit_grade_subject_grade_float(self):1102 assert_that(1103 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1104 1.67),1105 raises(TypeError))1106 def test_edit_grade_subject_grade_negative_int(self):1107 assert_that(1108 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1109 -5),1110 raises(ValueError))1111 def test_edit_grade_subject_grade_negative_float(self):1112 assert_that(1113 calling(self.temp_with_student_with_subject_with_grades.edit_grade_in_student_in_subject).with_args(1, 1, 1,1114 -3.76),1115 raises(TypeError))1116 # Testy delete_grade_in_student_in_subject1117 def test_delete_grade_in_student_in_subject(self):1118 assert_that(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject(1, 1, 1),1119 equal_to([5]))1120 def test_delete_grade_in_student_in_subject_2(self):1121 assert_that(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject(1, 2, 1),1122 equal_to([]))1123 def test_delete_grade_in_student_in_subject_id_out_of_range(self):1124 assert_that(1125 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(0, 1,1126 1),1127 raises(ValueError))1128 def test_delete_grade_in_student_in_subject_id_out_of_range_2(self):1129 assert_that(1130 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(4, 1,1131 1),1132 raises(ValueError))1133 def test_delete_grade_in_student_in_subject_subject_id_out_of_range(self):1134 assert_that(1135 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 0,1136 1),1137 raises(ValueError))1138 def test_delete_grade_in_student_in_subject_subject_id_out_of_range_2(self):1139 assert_that(1140 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 6,1141 1),1142 raises(ValueError))1143 def test_delete_grade_in_student_in_subject_grade_id_out_of_range(self):1144 assert_that(1145 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1146 0),1147 raises(ValueError))1148 def test_delete_grade_in_student_in_subject_grade_id_out_of_range_2(self):1149 assert_that(1150 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1151 9),1152 raises(ValueError))1153 def test_delete_grade_in_student_in_subject_id_none(self):1154 assert_that(1155 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(None,1156 1, 4),1157 raises(TypeError))1158 def test_delete_grade_in_student_in_subject_id_object(self):1159 assert_that(1160 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args({}, 1,1161 4),1162 raises(TypeError))1163 def test_delete_grade_in_student_in_subject_id_array(self):1164 assert_that(1165 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args([], 1,1166 4),1167 raises(TypeError))1168 def test_delete_grade_in_student_in_subject_id_true(self):1169 assert_that(1170 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(True,1171 1, 4),1172 raises(TypeError))1173 def test_delete_grade_in_student_in_subject_id_false(self):1174 assert_that(1175 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(False,1176 1,1177 4),1178 raises(TypeError))1179 def test_delete_grade_in_student_in_subject_id_string(self):1180 assert_that(1181 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args('abc',1182 1,1183 4),1184 raises(TypeError))1185 def test_delete_grade_in_student_in_subject_id_string_number(self):1186 assert_that(1187 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args('3',1188 1, 4),1189 raises(TypeError))1190 def test_delete_grade_in_student_in_subject_id_float(self):1191 assert_that(1192 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(2.31,1193 1, 4),1194 raises(TypeError))1195 def test_delete_grade_in_student_in_subject_id_negative_int(self):1196 assert_that(1197 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(-3, 1,1198 4),1199 raises(ValueError))1200 def test_delete_grade_in_student_in_subject_id_negative_float(self):1201 assert_that(1202 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(-2.16,1203 1,1204 4),1205 raises(TypeError))1206 def test_delete_grade_in_student_in_subject_subject_id_none(self):1207 assert_that(1208 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1209 None,1210 4),1211 raises(TypeError))1212 def test_delete_grade_in_student_in_subject_subject_id_object(self):1213 assert_that(1214 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, {},1215 4),1216 raises(TypeError))1217 def test_delete_grade_in_student_in_subject_subject_id_array(self):1218 assert_that(1219 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, [],1220 4),1221 raises(TypeError))1222 def test_delete_grade_in_student_in_subject_subject_id_true(self):1223 assert_that(1224 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1225 True,1226 4),1227 raises(TypeError))1228 def test_delete_grade_in_student_in_subject_subject_id_false(self):1229 assert_that(1230 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1231 False,1232 4),1233 raises(TypeError))1234 def test_delete_grade_in_student_in_subject_subject_id_string(self):1235 assert_that(1236 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1237 'abc',1238 4),1239 raises(TypeError))1240 def test_delete_grade_in_student_in_subject_subject_id_string_number(self):1241 assert_that(1242 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1243 '3',1244 4),1245 raises(TypeError))1246 def test_delete_grade_in_student_in_subject_subject_id_float(self):1247 assert_that(1248 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1249 2.31,1250 4),1251 raises(TypeError))1252 def test_delete_grade_in_student_in_subject_subject_id_negative_int(self):1253 assert_that(1254 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, -1,1255 4),1256 raises(ValueError))1257 def test_delete_grade_in_student_in_subject_subject_id_negative_float(self):1258 assert_that(1259 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1,1260 -2.16,1261 4),1262 raises(TypeError))1263 def test_delete_grade_in_student_in_subject_grade_id_none(self):1264 assert_that(1265 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1266 None),1267 raises(TypeError))1268 def test_delete_grade_in_student_in_subject_grade_id_object(self):1269 assert_that(1270 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1271 {}),1272 raises(TypeError))1273 def test_delete_grade_in_student_in_subject_grade_id_array(self):1274 assert_that(1275 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1276 []),1277 raises(TypeError))1278 def test_delete_grade_in_student_in_subject_grade_id_true(self):1279 assert_that(1280 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1281 True),1282 raises(TypeError))1283 def test_delete_grade_in_student_in_subject_grade_id_false(self):1284 assert_that(1285 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1286 False),1287 raises(TypeError))1288 def test_delete_grade_in_student_in_subject_grade_id_string(self):1289 assert_that(1290 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1291 'abc'),1292 raises(TypeError))1293 def test_delete_grade_in_student_in_subject_grade_id_string_number(self):1294 assert_that(1295 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1296 '3'),1297 raises(TypeError))1298 def test_delete_grade_in_student_in_subject_grade_id_float(self):1299 assert_that(1300 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1301 2.31),1302 raises(TypeError))1303 def test_delete_grade_in_student_in_subject_grade_id_negative_int(self):1304 assert_that(1305 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1306 -1),1307 raises(ValueError))1308 def test_delete_grade_in_student_in_subject_grade_id_negative_float(self):1309 assert_that(1310 calling(self.temp_with_student_with_subject_with_grades.delete_grade_in_student_in_subject).with_args(1, 1,1311 -2.16),1312 raises(TypeError))1313 # Testy average_of_subject_in_student1314 def test_average_of_subject_in_student(self):1315 assert_that(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student(1, 1), equal_to(3.5))1316 def test_average_of_subject_in_student_2(self):1317 assert_that(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student(1, 2), equal_to(2))1318 def test_average_of_subject_in_student_close_to(self):1319 assert_that(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student(1, 2),1320 close_to(1.8, 0.25))1321 def test_average_of_subject_in_student_close_to_2(self):1322 assert_that(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student(1, 1),1323 close_to(3, 0.6))1324 def test_average_of_subject_in_student_id_out_of_range(self):1325 assert_that(1326 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(0, 1),1327 raises(ValueError))1328 def test_average_of_subject_in_student_id_out_of_range_2(self):1329 assert_that(1330 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(4, 1),1331 raises(ValueError))1332 def test_average_of_subject_in_student_none_id(self):1333 assert_that(1334 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(None, 1),1335 raises(TypeError))1336 def test_average_of_subject_in_student_none_subject_id(self):1337 assert_that(1338 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, None),1339 raises(TypeError))1340 def test_average_of_subject_in_student_none(self):1341 assert_that(1342 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(None,1343 None),1344 raises(TypeError))1345 def test_average_of_subject_in_student_object_id(self):1346 assert_that(1347 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args({}, 1),1348 raises(TypeError))1349 def test_average_of_subject_in_student_object_subject_id(self):1350 assert_that(1351 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, {}),1352 raises(TypeError))1353 def test_average_of_subject_in_student_object(self):1354 assert_that(1355 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args({}, {}),1356 raises(TypeError))1357 def test_average_of_subject_in_student_true_id(self):1358 assert_that(1359 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(True, 1),1360 raises(TypeError))1361 def test_average_of_subject_in_student_true_subject_id(self):1362 assert_that(1363 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, True),1364 raises(TypeError))1365 def test_average_of_subject_in_student_true(self):1366 assert_that(1367 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(True,1368 True),1369 raises(TypeError))1370 def test_average_of_subject_in_student_false_id(self):1371 assert_that(1372 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(False, 1),1373 raises(TypeError))1374 def test_average_of_subject_in_student_false_subject_id(self):1375 assert_that(1376 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, False),1377 raises(TypeError))1378 def test_average_of_subject_in_student_false(self):1379 assert_that(1380 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(False,1381 False),1382 raises(TypeError))1383 def test_average_of_subject_in_student_string_id(self):1384 assert_that(1385 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args('abc', 1),1386 raises(TypeError))1387 def test_average_of_subject_in_student_string_number_id(self):1388 assert_that(1389 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args('2', 1),1390 raises(TypeError))1391 def test_average_of_subject_in_student_string_subject_id(self):1392 assert_that(1393 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(2, 'abc'),1394 raises(ValueError))1395 def test_average_of_subject_in_student_string_number_subject_id(self):1396 assert_that(1397 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(2, '3'),1398 raises(ValueError))1399 def test_average_of_subject_in_student_string(self):1400 assert_that(1401 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args('b2',1402 '3a'),1403 raises(TypeError))1404 def test_average_of_subject_in_student_float_id(self):1405 assert_that(1406 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(2.31, 1),1407 raises(TypeError))1408 def test_average_of_subject_in_student_float_subject_id(self):1409 assert_that(1410 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, 1.67),1411 raises(TypeError))1412 def test_average_of_subject_in_student_float(self):1413 assert_that(1414 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(3.12,1415 4.33),1416 raises(TypeError))1417 def test_average_of_subject_in_student_negative_int_id(self):1418 assert_that(1419 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(-3, 1),1420 raises(ValueError))1421 def test_average_of_subject_in_student_negative_int_subject_id(self):1422 assert_that(1423 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, -8),1424 raises(ValueError))1425 def test_average_of_subject_in_student_negative_int(self):1426 assert_that(1427 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(-2, -5),1428 raises(ValueError))1429 def test_average_of_subject_in_student_negative_float_id(self):1430 assert_that(1431 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(-2.31, 1),1432 raises(TypeError))1433 def test_average_of_subject_in_student_negative_float_subject_id(self):1434 assert_that(1435 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(1, -1.67),1436 raises(TypeError))1437 def test_average_of_subject_in_student_negative_float(self):1438 assert_that(1439 calling(self.temp_with_student_with_subject_with_grades.average_of_subject_in_student).with_args(-3.12,1440 -4.33),1441 raises(TypeError))1442 # Testy average_of_student1443 def test_average_of_student(self):1444 assert_that(self.temp_with_student_with_subject_with_grades.average_of_student(1), equal_to(2.5))1445 def test_average_of_student_2(self):1446 assert_that(self.temp_with_student_with_subject.average_of_student(1), equal_to(1.0))1447 def test_average_of_student_close_to(self):1448 assert_that(self.temp_with_student_with_subject_with_grades.average_of_student(1), close_to(2, 0.55))1449 def test_average_of_student_close_to_2(self):1450 assert_that(self.temp_with_student_with_subject.average_of_student(1), close_to(0.9, 0.15))1451 def test_average_of_student_out_of_range(self):1452 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(0),1453 raises(ValueError))1454 def test_average_of_student_out_of_range_2(self):1455 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(4),1456 raises(ValueError))1457 def test_average_of_student_none(self):1458 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(None),1459 raises(TypeError))1460 def test_average_of_student_object(self):1461 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args({}),1462 raises(TypeError))1463 def test_average_of_student_array(self):1464 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args([]),1465 raises(TypeError))1466 def test_average_of_student_true(self):1467 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(True),1468 raises(TypeError))1469 def test_average_of_student_false(self):1470 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(False),1471 raises(TypeError))1472 def test_average_of_student_string(self):1473 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args('abc'),1474 raises(TypeError))1475 def test_average_of_student_string_number(self):1476 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args('2'),1477 raises(TypeError))1478 def test_average_of_student_float(self):1479 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(2.15),1480 raises(TypeError))1481 def test_average_of_student_negative_int(self):1482 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(-3),1483 raises(ValueError))1484 def test_average_of_student_negative_float(self):1485 assert_that(calling(self.temp_with_student_with_subject_with_grades.average_of_student).with_args(-3.45),1486 raises(TypeError))1487 # Testy add_remark_to_student1488 def test_add_remark_to_student(self):1489 assert_that(self.temp_with_students.add_remark_to_student(1, 'Uwaga 1'), equal_to(['Uwaga 1']))1490 def test_add_remark_to_student_2(self):1491 self.temp_with_students.add_remark_to_student(2, 'Uwaga 1')1492 assert_that(self.temp_with_students.add_remark_to_student(2, 'Uwaga 2'), equal_to(['Uwaga 1', 'Uwaga 2']))1493 def test_add_remark_to_student_none_student_id(self):1494 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(None, 'Uwaga'),1495 raises(TypeError))1496 def test_add_remark_to_student_none_text(self):1497 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, None), raises(TypeError))1498 def test_add_remark_to_student_none(self):1499 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(None, None), raises(TypeError))1500 def test_add_remark_to_student_object_student_id(self):1501 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args({}, 'Uwaga'), raises(TypeError))1502 def test_add_remark_to_student_object_text(self):1503 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, {}), raises(TypeError))1504 def test_add_remark_to_student_object(self):1505 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args({}, {}), raises(TypeError))1506 def test_add_remark_to_student_array_student_id(self):1507 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args([], 'Uwaga'), raises(TypeError))1508 def test_add_remark_to_student_array_text(self):1509 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, []), raises(TypeError))1510 def test_add_remark_to_student_array(self):1511 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args([], []), raises(TypeError))1512 def test_add_remark_to_student_true_student_id(self):1513 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(True, 'Uwaga'),1514 raises(TypeError))1515 def test_add_remark_to_student_true_text(self):1516 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, True), raises(TypeError))1517 def test_add_remark_to_student_true(self):1518 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(True, True), raises(TypeError))1519 def test_add_remark_to_student_false_student_id(self):1520 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(False, 'Uwaga'),1521 raises(TypeError))1522 def test_add_remark_to_student_false_text(self):1523 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, False), raises(TypeError))1524 def test_add_remark_to_student_false(self):1525 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(False, False), raises(TypeError))1526 def test_add_remark_to_student_string_student_id(self):1527 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args('abc', 'Uwaga'),1528 raises(TypeError))1529 def test_add_remark_to_student_string_number_student_id(self):1530 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args('3', 'Uwaga'), raises(TypeError))1531 def test_add_remark_to_student_int_text(self):1532 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, 2), raises(TypeError))1533 def test_add_remark_to_student_string_student_id_int_text(self):1534 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args('32a', 5), raises(TypeError))1535 def test_add_remark_to_student_float_student_id(self):1536 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(2.15, 'Uwaga'),1537 raises(TypeError))1538 def test_add_remark_to_student_float_text(self):1539 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, 3.87), raises(TypeError))1540 def test_add_remark_to_student_float(self):1541 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1.32, 4.12), raises(TypeError))1542 def test_add_remark_to_student_negative_int_student_id(self):1543 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(-3, 'Uwaga'), raises(ValueError))1544 def test_add_remark_to_student_negative_int_text(self):1545 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, -1), raises(TypeError))1546 def test_add_remark_to_student_negative_int(self):1547 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(-2, -9), raises(ValueError))1548 def test_add_remark_to_student_negative_float_student_id(self):1549 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(-3.12, 'Uwaga'),1550 raises(TypeError))1551 def test_add_remark_to_student_negative_float_text(self):1552 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(1, -1.55), raises(TypeError))1553 def test_add_remark_to_student_negative_float(self):1554 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(-2.12, -9.65), raises(TypeError))1555 def test_add_remark_to_student_id_out_of_range(self):1556 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(0, 'Uwaga'), raises(ValueError))1557 def test_add_remark_to_student_id_out_of_range_2(self):1558 assert_that(calling(self.temp_with_students.add_remark_to_student).with_args(5, 'Uwaga'), raises(ValueError))1559 # Testy get_remarks_from_student1560 def test_get_remarks_from_student(self):1561 assert_that(self.temp_with_students_with_remarks.get_remarks_from_student(1), equal_to(['Uwaga 1', 'Uwaga 2']))1562 def test_get_remarks_from_student_out_of_range(self):1563 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(0),1564 raises(ValueError))1565 def test_get_remarks_from_student_out_of_range_2(self):1566 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(3),1567 raises(ValueError))1568 def test_get_remarks_from_student_none(self):1569 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(None),1570 raises(TypeError))1571 def test_get_remarks_from_student_object(self):1572 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args({}),1573 raises(TypeError))1574 def test_get_remarks_from_student_array(self):1575 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args([]),1576 raises(TypeError))1577 def test_get_remarks_from_student_true(self):1578 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(True),1579 raises(TypeError))1580 def test_get_remarks_from_student_false(self):1581 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(False),1582 raises(TypeError))1583 def test_get_remarks_from_student_string(self):1584 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args('abc'),1585 raises(TypeError))1586 def test_get_remarks_from_student_string_number(self):1587 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args('2'),1588 raises(TypeError))1589 def test_get_remarks_from_student_float(self):1590 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(2.15),1591 raises(TypeError))1592 def test_get_remarks_from_student_negative_int(self):1593 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(-3),1594 raises(ValueError))1595 def test_get_remarks_from_student_negative_float(self):1596 assert_that(calling(self.temp_with_students_with_remarks.get_remarks_from_student).with_args(-3.45),1597 raises(TypeError))1598 # Testy edit_remark_in_student1599 def test_edit_remark_in_student(self):1600 assert_that(self.temp_with_students_with_remarks.edit_remark_in_student(1, 1, 'Uwaga 1 po edycji'),1601 equal_to(['Uwaga 1 po edycji', 'Uwaga 2']))1602 def test_edit_remark_in_student_2(self):1603 assert_that(self.temp_with_students_with_remarks.edit_remark_in_student(1, 2, 'Uwaga 2 po edycji'),1604 equal_to(['Uwaga 1', 'Uwaga 2 po edycji']))1605 def test_edit_remark_in_student_id_out_of_range(self):1606 assert_that(1607 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(0, 1, 'Uwaga po edycji'),1608 raises(ValueError))1609 def test_edit_remark_in_student_id_out_of_range_2(self):1610 assert_that(1611 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(4, 1, 'Uwaga po edycji'),1612 raises(ValueError))1613 def test_edit_remark_in_student_remark_id_out_of_range(self):1614 assert_that(1615 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 0, 'Uwaga po edycji'),1616 raises(ValueError))1617 def test_edit_remark_in_student_remark_id_out_of_range_2(self):1618 assert_that(1619 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 6, 'Uwaga po edycji'),1620 raises(ValueError))1621 def test_edit_remark_in_student_id_none(self):1622 assert_that(1623 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(None, 1, 'Uwaga po edycji'),1624 raises(TypeError))1625 def test_edit_remark_in_student_id_object(self):1626 assert_that(1627 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args({}, 1, 'Uwaga po edycji'),1628 raises(TypeError))1629 def test_edit_remark_in_student_id_array(self):1630 assert_that(1631 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args([], 1, 'Uwaga po edycji'),1632 raises(TypeError))1633 def test_edit_remark_in_student_id_true(self):1634 assert_that(1635 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(True, 1, 'Uwaga po edycji'),1636 raises(TypeError))1637 def test_edit_remark_in_student_id_false(self):1638 assert_that(1639 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(False, 1, 'Uwaga po edycji'),1640 raises(TypeError))1641 def test_edit_remark_in_student_id_string(self):1642 assert_that(1643 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args('abc', 1, 'Uwaga po edycji'),1644 raises(TypeError))1645 def test_edit_remark_in_student_id_string_number(self):1646 assert_that(1647 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args('2', 1, 'Uwaga po edycji'),1648 raises(TypeError))1649 def test_edit_remark_in_student_id_float(self):1650 assert_that(1651 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(2.14, 1, 'Uwaga po edycji'),1652 raises(TypeError))1653 def test_edit_remark_in_student_id_negative_int(self):1654 assert_that(1655 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(-3, 1, 'Uwaga po edycji'),1656 raises(ValueError))1657 def test_edit_remark_in_student_id_negative_float(self):1658 assert_that(1659 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(-2.51, 1, 'Uwaga po edycji'),1660 raises(TypeError))1661 def test_edit_remark_in_student_remark_id_none(self):1662 assert_that(1663 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, None, 'Uwaga po edycji'),1664 raises(TypeError))1665 def test_edit_remark_in_student_remark_id_object(self):1666 assert_that(1667 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, {}, 'Uwaga po edycji'),1668 raises(TypeError))1669 def test_edit_remark_in_student_remark_id_array(self):1670 assert_that(1671 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, [], 'Uwaga po edycji'),1672 raises(TypeError))1673 def test_edit_remark_in_student_remark_id_true(self):1674 assert_that(1675 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, True, 'Uwaga po edycji'),1676 raises(TypeError))1677 def test_edit_remark_in_student_remark_id_false(self):1678 assert_that(1679 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, False, 'Uwaga po edycji'),1680 raises(TypeError))1681 def test_edit_remark_in_student_remark_id_string(self):1682 assert_that(1683 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 'abc', 'Uwaga po edycji'),1684 raises(TypeError))1685 def test_edit_remark_in_student_remark_id_string_number(self):1686 assert_that(1687 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, '3', 'Uwaga po edycji'),1688 raises(TypeError))1689 def test_edit_remark_in_student_remark_id_float(self):1690 assert_that(1691 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 2.14, 'Uwaga po edycji'),1692 raises(TypeError))1693 def test_edit_remark_in_student_remark_id_negative_int(self):1694 assert_that(1695 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, -3, 'Uwaga po edycji'),1696 raises(ValueError))1697 def test_edit_remark_in_student_remark_id_negative_float(self):1698 assert_that(1699 calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, -2.51, 'Uwaga po edycji'),1700 raises(TypeError))1701 def test_edit_remark_in_student_text_none(self):1702 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, None),1703 raises(TypeError))1704 def test_edit_remark_in_student_text_object(self):1705 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, {}),1706 raises(TypeError))1707 def test_edit_remark_in_student_text_array(self):1708 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, []),1709 raises(TypeError))1710 def test_edit_remark_in_student_text_true(self):1711 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, True),1712 raises(TypeError))1713 def test_edit_remark_in_student_text_false(self):1714 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, False),1715 raises(TypeError))1716 def test_edit_remark_in_student_text_int(self):1717 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, 3),1718 raises(TypeError))1719 def test_edit_remark_in_student_text_float(self):1720 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, 3.14),1721 raises(TypeError))1722 def test_edit_remark_in_student_text_negative_int(self):1723 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, -4),1724 raises(TypeError))1725 def test_edit_remark_in_student_text_negative_float(self):1726 assert_that(calling(self.temp_with_students_with_remarks.edit_remark_in_student).with_args(1, 1, -4.11),1727 raises(TypeError))1728 # Testy delete_remark_in_student1729 def test_delete_remark_in_student(self):1730 assert_that(self.temp_with_students_with_remarks.delete_remark_in_student(1, 1), equal_to(['Uwaga 2']))1731 def test_delete_remark_in_student_2(self):1732 self.temp_with_students_with_remarks.delete_remark_in_student(1, 2)1733 assert_that(self.temp_with_students_with_remarks.delete_remark_in_student(1, 1), equal_to([]))1734 def test_delete_remark_in_student_remark_id_out_of_range(self):1735 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(0, 1),1736 raises(ValueError))1737 def test_delete_remark_in_student_remark_id_out_of_range_2(self):1738 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(6, 1),1739 raises(ValueError))1740 def test_delete_remark_in_student_id_out_of_range(self):1741 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, 0),1742 raises(ValueError))1743 def test_delete_remark_in_student_id_out_of_range_2(self):1744 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, 4),1745 raises(ValueError))1746 def test_delete_remark_in_student_none_remark_id(self):1747 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(None, 1),1748 raises(TypeError))1749 def test_delete_remark_in_student_none_grade_id(self):1750 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, None),1751 raises(TypeError))1752 def test_delete_remark_in_student_none(self):1753 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(None, None),1754 raises(TypeError))1755 def test_delete_remark_in_student_object_remark_id(self):1756 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args({}, 1),1757 raises(TypeError))1758 def test_delete_remark_in_student_object_grade_id(self):1759 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, {}),1760 raises(TypeError))1761 def test_delete_remark_in_student_object(self):1762 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args({}, {}),1763 raises(TypeError))1764 def test_delete_remark_in_student_true_remark_id(self):1765 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(True, 1),1766 raises(TypeError))1767 def test_delete_remark_in_student_true_grade_id(self):1768 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, True),1769 raises(TypeError))1770 def test_delete_remark_in_student_true(self):1771 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(True, True),1772 raises(TypeError))1773 def test_delete_remark_in_student_false_remark_id(self):1774 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(False, 1),1775 raises(TypeError))1776 def test_delete_remark_in_student_false_grade_id(self):1777 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, False),1778 raises(TypeError))1779 def test_delete_remark_in_student_false(self):1780 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(False, False),1781 raises(TypeError))1782 def test_delete_remark_in_student_string_remark_id(self):1783 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args('abc', 1),1784 raises(TypeError))1785 def test_delete_remark_in_student_string_number_remark_id(self):1786 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args('2', 1),1787 raises(TypeError))1788 def test_delete_remark_in_student_string_grade_id(self):1789 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(2, 'abc'),1790 raises(ValueError))1791 def test_delete_remark_in_student_string_number_grade_id(self):1792 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(2, '3'),1793 raises(ValueError))1794 def test_delete_remark_in_student_string(self):1795 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args('b2', '3a'),1796 raises(TypeError))1797 def test_delete_remark_in_student_float_remark_id(self):1798 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(2.31, 1),1799 raises(TypeError))1800 def test_delete_remark_in_student_float_grade_id(self):1801 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, 1.67),1802 raises(TypeError))1803 def test_delete_remark_in_student_float(self):1804 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(3.12, 4.33),1805 raises(TypeError))1806 def test_delete_remark_in_student_negative_int_remark_id(self):1807 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(-3, 1),1808 raises(ValueError))1809 def test_delete_remark_in_student_negative_int_grade_id(self):1810 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, -8),1811 raises(ValueError))1812 def test_delete_remark_in_student_negative_int(self):1813 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(-2, -5),1814 raises(ValueError))1815 def test_delete_remark_in_student_negative_float_remark_id(self):1816 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(-2.31, 1),1817 raises(TypeError))1818 def test_delete_remark_in_student_negative_float_grade_id(self):1819 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(1, -1.67),1820 raises(TypeError))1821 def test_delete_remark_in_student_negative_float(self):1822 assert_that(calling(self.temp_with_students_with_remarks.delete_remark_in_student).with_args(-3.12, -4.33),1823 raises(TypeError))1824 def test_export_data_to_csv(self):1825 assert_that(self.temp_with_student_with_subject_with_grades.export_data_to_csv(),1826 equal_to('Wyeksportowano dane'))1827 def test_import_data_from_csv(self):1828 assert_that(self.temp_with_student_with_subject_with_grades.import_data_from_csv(),1829 equal_to('Zaimportowano dane'))1830 def tearDown(self):1831 self.temp = None1832 self.temp_with_students = None1833 self.temp_with_student_with_subject = None1834 self.temp_with_student_with_subject_with_grades = None...

Full Screen

Full Screen

test_student.py

Source:test_student.py Github

copy

Full Screen

...69 assert_that(self.temp.edit_student(firstname='Marcin'), has_key('firstname'))70 def test_edit_student_has_value(self):71 assert_that(self.temp.edit_student(firstname='Kamil'), has_value(12))72 def test_edit_student_firstname_object(self):73 assert_that(calling(self.temp.edit_student).with_args({}, 'Nowak', 10), raises(TypeError))74 def test_edit_student_firstname_array(self):75 assert_that(calling(self.temp.edit_student).with_args([], 'Nowak', 10), raises(TypeError))76 def test_edit_student_firstname_true(self):77 assert_that(calling(self.temp.edit_student).with_args(True, 'Nowak', 10), raises(TypeError))78 def test_edit_student_firstname_false(self):79 assert_that(calling(self.temp.edit_student).with_args(False, 'Nowak', 10), raises(TypeError))80 def test_edit_student_firstname_int(self):81 assert_that(calling(self.temp.edit_student).with_args(12, 'Nowak', 10), raises(TypeError))82 def test_edit_student_firstname_float(self):83 assert_that(calling(self.temp.edit_student).with_args(3.14, 'Nowak', 10), raises(TypeError))84 def test_edit_student_firstname_int_negative(self):85 assert_that(calling(self.temp.edit_student).with_args(-12, 'Nowak', 10), raises(TypeError))86 def test_edit_student_firstname_float_negative(self):87 assert_that(calling(self.temp.edit_student).with_args(-2.56, 'Nowak', 10), raises(TypeError))88 def test_edit_student_lastname_object(self):89 assert_that(calling(self.temp.edit_student).with_args('Marcin', {}, 10), raises(TypeError))90 def test_edit_student_lastname_array(self):91 assert_that(calling(self.temp.edit_student).with_args('Marcin', [], 10), raises(TypeError))92 def test_edit_student_lastname_true(self):93 assert_that(calling(self.temp.edit_student).with_args('Marcin', True, 10), raises(TypeError))94 def test_edit_student_lastname_false(self):95 assert_that(calling(self.temp.edit_student).with_args('Marcin', False, 10), raises(TypeError))96 def test_edit_student_lastname_int(self):97 assert_that(calling(self.temp.edit_student).with_args('Marcin', 31, 10), raises(TypeError))98 def test_edit_student_lastname_float(self):99 assert_that(calling(self.temp.edit_student).with_args('Marcin', 2.13, 10), raises(TypeError))100 def test_edit_student_lastname_int_negative(self):101 assert_that(calling(self.temp.edit_student).with_args('Marcin', -12, 10), raises(TypeError))102 def test_edit_student_lastname_float_negative(self):103 assert_that(calling(self.temp.edit_student).with_args('Marcin', -2.45, 10), raises(TypeError))104 def test_edit_student_age_object(self):105 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', {}), raises(TypeError))106 def test_edit_student_age_array(self):107 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', []), raises(TypeError))108 def test_edit_student_age_true(self):109 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', True), raises(TypeError))110 def test_edit_student_age_false(self):111 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', False), raises(TypeError))112 def test_edit_student_age_string(self):113 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', 'abc'), raises(TypeError))114 def test_edit_student_age_string_number(self):115 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', '23'), raises(TypeError))116 def test_edit_student_age_int_negative(self):117 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', -2), raises(TypeError))118 def test_edit_student_age_float_negative(self):119 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', -1.0), raises(TypeError))120 def test_edit_student_age_zero(self):121 assert_that(calling(self.temp.edit_student).with_args('Marcin', 'Nowak', 0), raises(TypeError))122 # Testy add_subject123 def test_add_subject(self):124 assert_that(self.temp.add_subject('Polski'), equal_to({125 'firstname': 'Jan',126 'lastname': 'Kowalski',127 'age': 12,128 'subjects': ['Polski']129 }))130 def test_add_subject_2(self):131 self.temp.add_subject('Matematyka')132 assert_that(self.temp.add_subject('Polski'), equal_to({133 'firstname': 'Jan',134 'lastname': 'Kowalski',135 'age': 12,136 'subjects': ['Matematyka', 'Polski']137 }))138 def test_add_subject_has_key(self):139 assert_that(self.temp.add_subject('Polski'), has_key('subjects'))140 def test_add_subject_has_value(self):141 assert_that(self.temp.add_subject('Biologia'), has_value(12))142 def test_add_subject_none(self):143 assert_that(calling(self.temp.add_subject).with_args(None), raises(TypeError))144 def test_add_subject_object(self):145 assert_that(calling(self.temp.add_subject).with_args({}), raises(TypeError))146 def test_add_subject_array(self):147 assert_that(calling(self.temp.add_subject).with_args([]), raises(TypeError))148 def test_add_subject_true(self):149 assert_that(calling(self.temp.add_subject).with_args(True), raises(TypeError))150 def test_add_subject_false(self):151 assert_that(calling(self.temp.add_subject).with_args(False), raises(TypeError))152 def test_add_subject_int(self):153 assert_that(calling(self.temp.add_subject).with_args(12), raises(TypeError))154 def test_add_subject_float(self):155 assert_that(calling(self.temp.add_subject).with_args(3.12), raises(TypeError))156 def test_add_subject_negative_int(self):157 assert_that(calling(self.temp.add_subject).with_args(-8), raises(TypeError))158 def test_add_subject_negative_float(self):159 assert_that(calling(self.temp.add_subject).with_args(-1.23), raises(TypeError))160 # Testy get_subjects161 def test_get_subjects(self):162 assert_that(self.temp_with_subjects.get_subjects(), equal_to(['Matematyka', 'Polski']))163 # Testy edit_subject164 def test_edit_subject(self):165 assert_that(self.temp_with_subjects.edit_subject(1, 'Angielski'), equal_to(['Angielski', 'Polski']))166 def test_edit_subject_2(self):167 assert_that(self.temp_with_subjects.edit_subject(2, 'Fizyka'), equal_to(['Matematyka', 'Fizyka']))168 def test_edit_subject_none_subject_id(self):169 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(None, 'Fizyka'), raises(TypeError))170 def test_edit_subject_none_name(self):171 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, None), raises(TypeError))172 def test_edit_subject_none(self):173 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(None, None), raises(TypeError))174 def test_edit_subject_object_subject_id(self):175 assert_that(calling(self.temp_with_subjects.edit_subject).with_args({}, 'Fizyka'), raises(TypeError))176 def test_edit_subject_object_name(self):177 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, {}), raises(TypeError))178 def test_edit_subject_object(self):179 assert_that(calling(self.temp_with_subjects.edit_subject).with_args({}, {}), raises(TypeError))180 def test_edit_subject_array_subject_id(self):181 assert_that(calling(self.temp_with_subjects.edit_subject).with_args([], 'Fizyka'), raises(TypeError))182 def test_edit_subject_array_name(self):183 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, []), raises(TypeError))184 def test_edit_subject_array(self):185 assert_that(calling(self.temp_with_subjects.edit_subject).with_args([], []), raises(TypeError))186 def test_edit_subject_true_subject_id(self):187 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(True, 'Fizyka'), raises(TypeError))188 def test_edit_subject_true_name(self):189 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, True), raises(TypeError))190 def test_edit_subject_true(self):191 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(True, True), raises(TypeError))192 def test_edit_subject_false_subject_id(self):193 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(False, 'Fizyka'), raises(TypeError))194 def test_edit_subject_false_name(self):195 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, False), raises(TypeError))196 def test_edit_subject_false(self):197 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(False, False), raises(TypeError))198 def test_edit_subject_string_subject_id(self):199 assert_that(calling(self.temp_with_subjects.edit_subject).with_args('abc', 'Fizyka'), raises(TypeError))200 def test_edit_subject_string_number_subject_id(self):201 assert_that(calling(self.temp_with_subjects.edit_subject).with_args('3', 'Fizyka'), raises(TypeError))202 def test_edit_subject_int_name(self):203 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, 2), raises(TypeError))204 def test_edit_subject_string_subject_id_int_name(self):205 assert_that(calling(self.temp_with_subjects.edit_subject).with_args('32a', 5), raises(TypeError))206 def test_edit_subject_float_subject_id(self):207 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(2.15, 'Fizyka'), raises(TypeError))208 def test_edit_subject_float_name(self):209 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, 3.87), raises(TypeError))210 def test_edit_subject_float(self):211 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1.32, 4.12), raises(TypeError))212 def test_edit_subject_negative_int_subject_id(self):213 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(-3, 'Fizyka'), raises(ValueError))214 def test_edit_subject_negative_int_name(self):215 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, -1), raises(TypeError))216 def test_edit_subject_negative_int(self):217 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(-2, -9), raises(ValueError))218 def test_edit_subject_negative_float_subject_id(self):219 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(-3.12, 'Fizyka'), raises(TypeError))220 def test_edit_subject_negative_float_name(self):221 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(1, -1.55), raises(TypeError))222 def test_edit_subject_negative_float(self):223 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(-2.12, -9.65), raises(TypeError))224 def test_edit_subject_id_out_of_range(self):225 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(0, 'Fizyka'), raises(ValueError))226 def test_edit_subject_id_out_of_range_2(self):227 assert_that(calling(self.temp_with_subjects.edit_subject).with_args(5, 'Fizyka'), raises(ValueError))228 # Testy delete_subject229 def test_delete_subject(self):230 assert_that(self.temp_with_subjects.delete_subject(1), equal_to(['Polski']))231 def test_delete_subject_2(self):232 assert_that(self.temp_with_subjects.delete_subject(2), equal_to(['Matematyka']))233 def test_delete_subject_3(self):234 self.temp_with_subjects.delete_subject(2)235 assert_that(self.temp_with_subjects.delete_subject(1), equal_to([]))236 def test_delete_subject_out_of_range(self):237 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(0), raises(ValueError))238 def test_delete_subject_out_of_range_2(self):239 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(3), raises(ValueError))240 def test_delete_subject_none(self):241 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(None), raises(TypeError))242 def test_delete_subject_object(self):243 assert_that(calling(self.temp_with_subjects.delete_subject).with_args({}), raises(TypeError))244 def test_delete_subject_array(self):245 assert_that(calling(self.temp_with_subjects.delete_subject).with_args([]), raises(TypeError))246 def test_delete_subject_true(self):247 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(True), raises(TypeError))248 def test_delete_subject_false(self):249 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(False), raises(TypeError))250 def test_delete_subject_string(self):251 assert_that(calling(self.temp_with_subjects.delete_subject).with_args('abc'), raises(TypeError))252 def test_delete_subject_string_number(self):253 assert_that(calling(self.temp_with_subjects.delete_subject).with_args('2'), raises(TypeError))254 def test_delete_subject_float(self):255 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(2.15), raises(TypeError))256 def test_delete_subject_negative_int(self):257 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(-3), raises(ValueError))258 def test_delete_subject_negative_float(self):259 assert_that(calling(self.temp_with_subjects.delete_subject).with_args(-3.45), raises(TypeError))260 # Testy add_grade261 def test_add_grade(self):262 assert_that(self.temp_with_subjects.add_grade(1, 4), equal_to({263 'Matematyka': [4],264 'Polski': []265 }))266 def test_add_grade_2(self):267 assert_that(self.temp_with_subjects.add_grade(2, 3), equal_to({268 'Matematyka': [],269 'Polski': [3]270 }))271 def test_add_grade_3(self):272 self.temp_with_subjects.add_grade(2, 3)273 assert_that(self.temp_with_subjects.add_grade(1, 5), equal_to({274 'Matematyka': [5],275 'Polski': [3]276 }))277 def test_add_grade_4(self):278 self.temp_with_subjects.add_grade(2, 3)279 assert_that(self.temp_with_subjects.add_grade(2, 5), equal_to({280 'Matematyka': [],281 'Polski': [3, 5]282 }))283 def test_add_grade_id_out_of_range(self):284 assert_that(calling(self.temp_with_subjects.add_grade).with_args(0, 4), raises(ValueError))285 def test_add_grade_id_out_of_range_2(self):286 assert_that(calling(self.temp_with_subjects.add_grade).with_args(6, 4), raises(ValueError))287 def test_add_grade_grade_out_of_range(self):288 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, -2), raises(ValueError))289 def test_add_grade_grade_out_of_range_2(self):290 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, 8), raises(ValueError))291 def test_add_grade_none_id(self):292 assert_that(calling(self.temp_with_subjects.add_grade).with_args(None, 3), raises(TypeError))293 def test_add_grade_none_grade(self):294 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, None), raises(TypeError))295 def test_add_grade_none(self):296 assert_that(calling(self.temp_with_subjects.add_grade).with_args(None, None), raises(TypeError))297 def test_add_grade_object_id(self):298 assert_that(calling(self.temp_with_subjects.add_grade).with_args({}, 3), raises(TypeError))299 def test_add_grade_object_grade(self):300 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, {}), raises(TypeError))301 def test_add_grade_object(self):302 assert_that(calling(self.temp_with_subjects.add_grade).with_args({}, {}), raises(TypeError))303 def test_add_grade_true_id(self):304 assert_that(calling(self.temp_with_subjects.add_grade).with_args(True, 3), raises(TypeError))305 def test_add_grade_true_grade(self):306 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, True), raises(TypeError))307 def test_add_grade_true(self):308 assert_that(calling(self.temp_with_subjects.add_grade).with_args(True, True), raises(TypeError))309 def test_add_grade_false_id(self):310 assert_that(calling(self.temp_with_subjects.add_grade).with_args(False, 3), raises(TypeError))311 def test_add_grade_false_grade(self):312 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, False), raises(TypeError))313 def test_add_grade_false(self):314 assert_that(calling(self.temp_with_subjects.add_grade).with_args(False, False), raises(TypeError))315 def test_add_grade_string_id(self):316 assert_that(calling(self.temp_with_subjects.add_grade).with_args('abc', 3), raises(TypeError))317 def test_add_grade_string_number_id(self):318 assert_that(calling(self.temp_with_subjects.add_grade).with_args('2', 3), raises(TypeError))319 def test_add_grade_string_grade(self):320 assert_that(calling(self.temp_with_subjects.add_grade).with_args(2, 'abc'), raises(TypeError))321 def test_add_grade_string_number_grade(self):322 assert_that(calling(self.temp_with_subjects.add_grade).with_args(2, '3'), raises(TypeError))323 def test_add_grade_string(self):324 assert_that(calling(self.temp_with_subjects.add_grade).with_args('b2', '3a'), raises(TypeError))325 def test_add_grade_float_id(self):326 assert_that(calling(self.temp_with_subjects.add_grade).with_args(2.31, 3), raises(TypeError))327 def test_add_grade_float_grade(self):328 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, 1.67), raises(TypeError))329 def test_add_grade_float(self):330 assert_that(calling(self.temp_with_subjects.add_grade).with_args(3.12, 4.33), raises(TypeError))331 def test_add_grade_negative_int_id(self):332 assert_that(calling(self.temp_with_subjects.add_grade).with_args(-3, 3), raises(ValueError))333 def test_add_grade_negative_int_grade(self):334 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, -8), raises(ValueError))335 def test_add_grade_negative_int(self):336 assert_that(calling(self.temp_with_subjects.add_grade).with_args(-2, -5), raises(ValueError))337 def test_add_grade_negative_float_id(self):338 assert_that(calling(self.temp_with_subjects.add_grade).with_args(-2.31, 3), raises(TypeError))339 def test_add_grade_negative_float_grade(self):340 assert_that(calling(self.temp_with_subjects.add_grade).with_args(1, -1.67), raises(TypeError))341 def test_add_grade_negative_float(self):342 assert_that(calling(self.temp_with_subjects.add_grade).with_args(-3.12, -4.33), raises(TypeError))343 # Testy get_grades344 def test_get_grades(self):345 assert_that(self.temp_with_grades.get_grades(1), equal_to([2, 5]))346 def test_get_grades_2(self):347 assert_that(self.temp_with_grades.get_grades(2), equal_to([2]))348 def test_get_grades_id_out_of_range(self):349 assert_that(calling(self.temp_with_grades.get_grades).with_args(-1), raises(ValueError))350 def test_get_grades_id_out_of_range_2(self):351 assert_that(calling(self.temp_with_grades.get_grades).with_args(4), raises(ValueError))352 def test_get_grades_none(self):353 assert_that(calling(self.temp_with_grades.get_grades).with_args(None), raises(TypeError))354 def test_get_grades_object(self):355 assert_that(calling(self.temp_with_grades.get_grades).with_args({}), raises(TypeError))356 def test_get_grades_array(self):357 assert_that(calling(self.temp_with_grades.get_grades).with_args([]), raises(TypeError))358 def test_get_grades_true(self):359 assert_that(calling(self.temp_with_grades.get_grades).with_args(True), raises(TypeError))360 def test_get_grades_false(self):361 assert_that(calling(self.temp_with_grades.get_grades).with_args(False), raises(TypeError))362 def test_get_grades_string(self):363 assert_that(calling(self.temp_with_grades.get_grades).with_args('abc'), raises(TypeError))364 def test_get_grades_string_number(self):365 assert_that(calling(self.temp_with_grades.get_grades).with_args('12'), raises(TypeError))366 def test_get_grades_float(self):367 assert_that(calling(self.temp_with_grades.get_grades).with_args(2.12), raises(TypeError))368 def test_get_grades_negative_int(self):369 assert_that(calling(self.temp_with_grades.get_grades).with_args(-4), raises(ValueError))370 def test_get_grades_negative_float(self):371 assert_that(calling(self.temp_with_grades.get_grades).with_args(-4.22), raises(TypeError))372 # Testy edit_grade373 def test_edit_grade(self):374 assert_that(self.temp_with_grades.edit_grade(1, 1, 6), equal_to([6, 5]))375 def test_edit_grade_2(self):376 assert_that(self.temp_with_grades.edit_grade(2, 1, 1), equal_to([1]))377 def test_edit_grade_subject_id_out_of_range(self):378 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(0, 1, 4), raises(ValueError))379 def test_edit_grade_subject_id_out_of_range_2(self):380 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(6, 1, 4), raises(ValueError))381 def test_edit_grade_id_out_of_range(self):382 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 0, 4), raises(ValueError))383 def test_edit_grade_id_out_of_range_2(self):384 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 4, 4), raises(ValueError))385 def test_edit_grade_grade_out_of_range(self):386 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, -2), raises(ValueError))387 def test_edit_grade_grade_out_of_range_2(self):388 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, 8), raises(ValueError))389 def test_edit_grade_subject_id_none(self):390 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(None, 1, 4), raises(TypeError))391 def test_edit_grade_subject_id_object(self):392 assert_that(calling(self.temp_with_subjects.edit_grade).with_args({}, 1, 4), raises(TypeError))393 def test_edit_grade_subject_id_array(self):394 assert_that(calling(self.temp_with_subjects.edit_grade).with_args([], 1, 4), raises(TypeError))395 def test_edit_grade_subject_id_true(self):396 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(True, 1, 4), raises(TypeError))397 def test_edit_grade_subject_id_false(self):398 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(False, 1, 4), raises(TypeError))399 def test_edit_grade_subject_id_string(self):400 assert_that(calling(self.temp_with_subjects.edit_grade).with_args('abc', 1, 4), raises(TypeError))401 def test_edit_grade_subject_id_string_number(self):402 assert_that(calling(self.temp_with_subjects.edit_grade).with_args('3', 1, 4), raises(TypeError))403 def test_edit_grade_subject_id_float(self):404 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(2.31, 1, 4), raises(TypeError))405 def test_edit_grade_subject_id_negative_int(self):406 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(-3, 1, 4), raises(ValueError))407 def test_edit_grade_subject_id_negative_float(self):408 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(-2.16, 1, 4), raises(TypeError))409 def test_edit_grade_grade_id_none(self):410 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, None, 4), raises(TypeError))411 def test_edit_grade_grade_id_object(self):412 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, {}, 4), raises(TypeError))413 def test_edit_grade_grade_id_array(self):414 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, [], 4), raises(TypeError))415 def test_edit_grade_grade_id_true(self):416 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, True, 4), raises(TypeError))417 def test_edit_grade_grade_id_false(self):418 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, False, 4), raises(TypeError))419 def test_edit_grade_grade_id_string(self):420 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 'abc', 4), raises(TypeError))421 def test_edit_grade_grade_id_string_number(self):422 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, '3', 4), raises(TypeError))423 def test_edit_grade_grade_id_float(self):424 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 2.31, 4), raises(TypeError))425 def test_edit_grade_grade_id_negative_int(self):426 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, -1, 4), raises(ValueError))427 def test_edit_grade_grade_id_negative_float(self):428 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, -2.16, 4), raises(TypeError))429 def test_edit_grade_grade_none(self):430 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, None), raises(ValueError))431 def test_edit_grade_grade_object(self):432 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, {}), raises(ValueError))433 def test_edit_grade_grade_array(self):434 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, []), raises(ValueError))435 def test_edit_grade_grade_true(self):436 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, True), raises(ValueError))437 def test_edit_grade_grade_false(self):438 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, False), raises(ValueError))439 def test_edit_grade_grade_string(self):440 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, 'abc'), raises(ValueError))441 def test_edit_grade_grade_string_number(self):442 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, '3'), raises(ValueError))443 def test_edit_grade_grade_float(self):444 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, 2.31), raises(ValueError))445 def test_edit_grade_grade_negative_int(self):446 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, -1), raises(ValueError))447 def test_edit_grade_grade_negative_float(self):448 assert_that(calling(self.temp_with_subjects.edit_grade).with_args(1, 1, -2.16), raises(ValueError))449 # Testy delete_grade450 def test_delete_grade(self):451 assert_that(self.temp_with_grades.delete_grade(1, 1), equal_to([5]))452 def test_delete_grade_2(self):453 assert_that(self.temp_with_grades.delete_grade(2, 1), equal_to([]))454 def test_delete_grade_subject_id_out_of_range(self):455 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(0, 1), raises(ValueError))456 def test_delete_grade_subject_id_out_of_range_2(self):457 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(6, 1), raises(ValueError))458 def test_delete_grade_id_out_of_range(self):459 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, 0), raises(ValueError))460 def test_delete_grade_id_out_of_range_2(self):461 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, 4), raises(ValueError))462 def test_delete_grade_none_subject_id(self):463 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(None, 1), raises(TypeError))464 def test_delete_grade_none_grade_id(self):465 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, None), raises(TypeError))466 def test_delete_grade_none(self):467 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(None, None), raises(TypeError))468 def test_delete_grade_object_subject_id(self):469 assert_that(calling(self.temp_with_subjects.delete_grade).with_args({}, 1), raises(TypeError))470 def test_delete_grade_object_grade_id(self):471 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, {}), raises(TypeError))472 def test_delete_grade_object(self):473 assert_that(calling(self.temp_with_subjects.delete_grade).with_args({}, {}), raises(TypeError))474 def test_delete_grade_true_subject_id(self):475 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(True, 1), raises(TypeError))476 def test_delete_grade_true_grade_id(self):477 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, True), raises(TypeError))478 def test_delete_grade_true(self):479 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(True, True), raises(TypeError))480 def test_delete_grade_false_subject_id(self):481 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(False, 1), raises(TypeError))482 def test_delete_grade_false_grade_id(self):483 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, False), raises(TypeError))484 def test_delete_grade_false(self):485 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(False, False), raises(TypeError))486 def test_delete_grade_string_subject_id(self):487 assert_that(calling(self.temp_with_subjects.delete_grade).with_args('abc', 1), raises(TypeError))488 def test_delete_grade_string_number_subject_id(self):489 assert_that(calling(self.temp_with_subjects.delete_grade).with_args('2', 1), raises(TypeError))490 def test_delete_grade_string_grade_id(self):491 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(2, 'abc'), raises(TypeError))492 def test_delete_grade_string_number_grade_id(self):493 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(2, '3'), raises(TypeError))494 def test_delete_grade_string(self):495 assert_that(calling(self.temp_with_subjects.delete_grade).with_args('b2', '3a'), raises(TypeError))496 def test_delete_grade_float_subject_id(self):497 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(2.31, 1), raises(TypeError))498 def test_delete_grade_float_grade_id(self):499 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, 1.67), raises(TypeError))500 def test_delete_grade_float(self):501 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(3.12, 4.33), raises(TypeError))502 def test_delete_grade_negative_int_subject_id(self):503 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(-3, 1), raises(ValueError))504 def test_delete_grade_negative_int_grade_id(self):505 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, -8), raises(ValueError))506 def test_delete_grade_negative_int(self):507 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(-2, -5), raises(ValueError))508 def test_delete_grade_negative_float_subject_id(self):509 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(-2.31, 1), raises(TypeError))510 def test_delete_grade_negative_float_grade_id(self):511 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(1, -1.67), raises(TypeError))512 def test_delete_grade_negative_float(self):513 assert_that(calling(self.temp_with_subjects.delete_grade).with_args(-3.12, -4.33), raises(TypeError))514 # Testy average_of_subject515 def test_average_of_subject(self):516 assert_that(self.temp_with_grades.average_of_subject(1), equal_to(3.5))517 def test_average_of_subject_2(self):518 assert_that(self.temp_with_grades.average_of_subject(2), equal_to(2))519 def test_average_of_subject_greater_than(self):520 assert_that(self.temp_with_grades.average_of_subject(1), greater_than(3.0))521 def test_average_of_subject_greater_than_2(self):522 assert_that(self.temp_with_grades.average_of_subject(2), greater_than(1.8))523 def test_average_of_subject_less_than(self):524 assert_that(self.temp_with_grades.average_of_subject(1), less_than(5.0))525 def test_average_of_subject_less_than_2(self):526 assert_that(self.temp_with_grades.average_of_subject(2), less_than(2.5))527 def test_average_of_subject_subject_id_out_of_range(self):528 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(-1), raises(ValueError))529 def test_average_of_subject_subject_id_out_of_range_2(self):530 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(4), raises(ValueError))531 def test_average_of_subject_none(self):532 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(None), raises(TypeError))533 def test_average_of_subject_object(self):534 assert_that(calling(self.temp_with_grades.average_of_subject).with_args({}), raises(TypeError))535 def test_average_of_subject_array(self):536 assert_that(calling(self.temp_with_grades.average_of_subject).with_args([]), raises(TypeError))537 def test_average_of_subject_true(self):538 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(True), raises(TypeError))539 def test_average_of_subject_false(self):540 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(False), raises(TypeError))541 def test_average_of_subject_string(self):542 assert_that(calling(self.temp_with_grades.average_of_subject).with_args('abc'), raises(TypeError))543 def test_average_of_subject_string_number(self):544 assert_that(calling(self.temp_with_grades.average_of_subject).with_args('12'), raises(TypeError))545 def test_average_of_subject_float(self):546 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(2.12), raises(TypeError))547 def test_average_of_subject_negative_int(self):548 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(-4), raises(ValueError))549 def test_average_of_subject_negative_float(self):550 assert_that(calling(self.temp_with_grades.average_of_subject).with_args(-4.22), raises(TypeError))551 # Testy average_of_student552 def test_average_of_student(self):553 assert_that(self.temp_with_grades.average_of_student(), equal_to(2.5))554 def test_average_of_student_2(self):555 assert_that(self.temp_with_subjects.average_of_student(), equal_to(1.0))556 def test_average_of_student_3(self):557 assert_that(self.temp_with_average.average_of_student(), equal_to(4.0))558 def test_average_of_student_without_grades(self):559 assert_that(self.temp.average_of_student(), equal_to(0))560 def test_average_of_student_greater_than(self):561 assert_that(self.temp_with_subjects.average_of_student(), greater_than(0.9))562 def test_average_of_student_greater_than_2(self):563 assert_that(self.temp_with_grades.average_of_student(), greater_than(2.0))564 def test_average_of_student_less_than(self):565 assert_that(self.temp_with_subjects.average_of_student(), less_than(3.0))566 def test_average_of_student_less_than_2(self):567 assert_that(self.temp_with_grades.average_of_student(), less_than(4.0))568 # Testy add_remark569 def test_add_remark(self):570 assert_that(self.temp.add_remark('Uwaga'), equal_to(['Uwaga']))571 def test_add_remark_2(self):572 self.temp.add_remark('Uwaga 1')573 assert_that(self.temp.add_remark('Uwaga 2'), equal_to(['Uwaga 1', 'Uwaga 2']))574 def test_add_remark_none(self):575 assert_that(calling(self.temp.add_remark).with_args(None), raises(TypeError))576 def test_add_remark_object(self):577 assert_that(calling(self.temp.add_remark).with_args({}), raises(TypeError))578 def test_add_remark_array(self):579 assert_that(calling(self.temp.add_remark).with_args([]), raises(TypeError))580 def test_add_remark_true(self):581 assert_that(calling(self.temp.add_remark).with_args(True), raises(TypeError))582 def test_add_remark_false(self):583 assert_that(calling(self.temp.add_remark).with_args(False), raises(TypeError))584 def test_add_remark_int(self):585 assert_that(calling(self.temp.add_remark).with_args(12), raises(TypeError))586 def test_add_remark_float(self):587 assert_that(calling(self.temp.add_remark).with_args(2.98), raises(TypeError))588 def test_add_remark_negative_int(self):589 assert_that(calling(self.temp.add_remark).with_args(-9), raises(TypeError))590 def test_add_remark_negative_float(self):591 assert_that(calling(self.temp.add_remark).with_args(-8.123), raises(TypeError))592 # Testy get_remarks593 def test_get_remarks(self):594 assert_that(self.temp_with_remarks.get_remarks(), equal_to(['Uwaga 1', 'Uwaga 2']))595 # Testy edit_remark596 def test_edit_remark(self):597 assert_that(self.temp_with_remarks.edit_remark(1, "Uwaga 1 po edycji"),598 equal_to(['Uwaga 1 po edycji', 'Uwaga 2']))599 def test_edit_remark_2(self):600 assert_that(self.temp_with_remarks.edit_remark(2, "Uwaga 2 po edycji"),601 equal_to(['Uwaga 1', 'Uwaga 2 po edycji']))602 def test_edit_remark_none_subject_id(self):603 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(None, 'Uwaga po edycji'), raises(TypeError))604 def test_edit_remark_none_name(self):605 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, None), raises(TypeError))606 def test_edit_remark_none(self):607 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(None, None), raises(TypeError))608 def test_edit_remark_object_subject_id(self):609 assert_that(calling(self.temp_with_remarks.edit_remark).with_args({}, 'Uwaga po edycji'), raises(TypeError))610 def test_edit_remark_object_name(self):611 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, {}), raises(TypeError))612 def test_edit_remark_object(self):613 assert_that(calling(self.temp_with_remarks.edit_remark).with_args({}, {}), raises(TypeError))614 def test_edit_remark_array_subject_id(self):615 assert_that(calling(self.temp_with_remarks.edit_remark).with_args([], 'Uwaga po edycji'), raises(TypeError))616 def test_edit_remark_array_name(self):617 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, []), raises(TypeError))618 def test_edit_remark_array(self):619 assert_that(calling(self.temp_with_remarks.edit_remark).with_args([], []), raises(TypeError))620 def test_edit_remark_true_subject_id(self):621 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(True, 'Uwaga po edycji'), raises(TypeError))622 def test_edit_remark_true_name(self):623 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, True), raises(TypeError))624 def test_edit_remark_true(self):625 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(True, True), raises(TypeError))626 def test_edit_remark_false_subject_id(self):627 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(False, 'Uwaga po edycji'), raises(TypeError))628 def test_edit_remark_false_name(self):629 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, False), raises(TypeError))630 def test_edit_remark_false(self):631 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(False, False), raises(TypeError))632 def test_edit_remark_string_subject_id(self):633 assert_that(calling(self.temp_with_remarks.edit_remark).with_args('abc', 'Uwaga po edycji'), raises(TypeError))634 def test_edit_remark_string_number_subject_id(self):635 assert_that(calling(self.temp_with_remarks.edit_remark).with_args('3', 'Uwaga po edycji'), raises(TypeError))636 def test_edit_remark_int_name(self):637 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, 2), raises(TypeError))638 def test_edit_remark_string_subject_id_int_name(self):639 assert_that(calling(self.temp_with_remarks.edit_remark).with_args('32a', 5), raises(TypeError))640 def test_edit_remark_float_subject_id(self):641 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(2.15, 'Uwaga po edycji'), raises(TypeError))642 def test_edit_remark_float_name(self):643 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, 3.87), raises(TypeError))644 def test_edit_remark_float(self):645 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1.32, 4.12), raises(TypeError))646 def test_edit_remark_negative_int_subject_id(self):647 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(-3, 'Uwaga po edycji'), raises(ValueError))648 def test_edit_remark_negative_int_name(self):649 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, -1), raises(TypeError))650 def test_edit_remark_negative_int(self):651 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(-2, -9), raises(ValueError))652 def test_edit_remark_negative_float_subject_id(self):653 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(-3.12, 'Uwaga po edycji'), raises(TypeError))654 def test_edit_remark_negative_float_name(self):655 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(1, -1.55), raises(TypeError))656 def test_edit_remark_negative_float(self):657 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(-2.12, -9.65), raises(TypeError))658 def test_edit_remark_id_out_of_range(self):659 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(0, 'Uwaga po edycji'), raises(ValueError))660 def test_edit_remark_id_out_of_range_2(self):661 assert_that(calling(self.temp_with_remarks.edit_remark).with_args(5, 'Uwaga po edycji'), raises(ValueError))662 # Testy delete_remark663 def test_delete_remark(self):664 assert_that(self.temp_with_remarks.delete_remark(1), equal_to(['Uwaga 2']))665 def test_delete_remark_2(self):666 self.temp_with_remarks.delete_remark(2)667 assert_that(self.temp_with_remarks.delete_remark(1), equal_to([]))668 def test_delete_remark_out_of_range(self):669 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(0), raises(ValueError))670 def test_delete_remark_out_of_range_2(self):671 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(3), raises(ValueError))672 def test_delete_remark_none(self):673 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(None), raises(TypeError))674 def test_delete_remark_object(self):675 assert_that(calling(self.temp_with_remarks.delete_remark).with_args({}), raises(TypeError))676 def test_delete_remark_array(self):677 assert_that(calling(self.temp_with_remarks.delete_remark).with_args([]), raises(TypeError))678 def test_delete_remark_true(self):679 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(True), raises(TypeError))680 def test_delete_remark_false(self):681 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(False), raises(TypeError))682 def test_delete_remark_string(self):683 assert_that(calling(self.temp_with_remarks.delete_remark).with_args('abc'), raises(TypeError))684 def test_delete_remark_string_number(self):685 assert_that(calling(self.temp_with_remarks.delete_remark).with_args('2'), raises(TypeError))686 def test_delete_remark_float(self):687 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(2.15), raises(TypeError))688 def test_delete_remark_negative_int(self):689 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(-3), raises(ValueError))690 def test_delete_remark_negative_float(self):691 assert_that(calling(self.temp_with_remarks.delete_remark).with_args(-3.45), raises(TypeError))692 def tearDown(self):693 self.temp = None694 self.temp_with_subjects = None695 self.temp_with_grades = None...

Full Screen

Full Screen

cpp_bindings_raises_exception_test.py

Source:cpp_bindings_raises_exception_test.py Github

copy

Full Screen

...21READONLY_MESSAGE = 'can\'t set attribute'22@ClangOnly23def CppBindings_ReadOnly_test():24 assert_that( calling( ycm_core.CompletionData().__setattr__ )25 .with_args( 'kind_', ycm_core.CompletionData().kind_ ),26 raises( AttributeError, READONLY_MESSAGE ) )27 assert_that( calling( ycm_core.Location().__setattr__ )28 .with_args( 'line_number_', 1 ),29 raises( AttributeError, READONLY_MESSAGE ) )30 assert_that( calling( ycm_core.Location().__setattr__ )31 .with_args( 'column_number_', 1 ),32 raises( AttributeError, READONLY_MESSAGE ) )33 assert_that( calling( ycm_core.Location().__setattr__ )34 .with_args( 'filename_', 'foo' ),35 raises( AttributeError, READONLY_MESSAGE ) )36 assert_that( calling( ycm_core.Range().__setattr__ )37 .with_args( 'end_', ycm_core.Range().end_ ),38 raises( AttributeError, READONLY_MESSAGE ) )39 assert_that( calling( ycm_core.Range().__setattr__ )40 .with_args( 'start_', ycm_core.Range().start_ ),41 raises( AttributeError, READONLY_MESSAGE ) )42 assert_that( calling( ycm_core.FixItChunk().__setattr__ )43 .with_args( 'range', ycm_core.FixItChunk().range ),44 raises( AttributeError, READONLY_MESSAGE ) )45 assert_that( calling( ycm_core.FixItChunk().__setattr__ )46 .with_args( 'replacement_text', 'foo' ),47 raises( AttributeError, READONLY_MESSAGE ) )48 assert_that( calling( ycm_core.FixIt().__setattr__ )49 .with_args( 'chunks', ycm_core.FixIt().chunks ),50 raises( AttributeError, READONLY_MESSAGE ) )51 assert_that( calling( ycm_core.FixIt().__setattr__ )52 .with_args( 'location', ycm_core.FixIt().location ),53 raises( AttributeError, READONLY_MESSAGE ) )54 assert_that( calling( ycm_core.FixIt().__setattr__ )55 .with_args( 'text', 'foo' ),56 raises( AttributeError, READONLY_MESSAGE ) )57 assert_that( calling( ycm_core.Diagnostic().__setattr__ )58 .with_args( 'ranges_', ycm_core.Diagnostic().ranges_ ),59 raises( AttributeError, READONLY_MESSAGE ) )60 assert_that( calling( ycm_core.Diagnostic().__setattr__ )61 .with_args( 'location_', ycm_core.Diagnostic().location_ ),62 raises( AttributeError, READONLY_MESSAGE ) )63 assert_that( calling( ycm_core.Diagnostic().__setattr__ )64 .with_args( 'location_extent_',65 ycm_core.Diagnostic().location_extent_ ),66 raises( AttributeError, READONLY_MESSAGE ) )67 assert_that( calling( ycm_core.Diagnostic().__setattr__ )68 .with_args( 'fixits_', ycm_core.Diagnostic().fixits_ ),69 raises( AttributeError, READONLY_MESSAGE ) )70 assert_that( calling( ycm_core.Diagnostic().__setattr__ )71 .with_args( 'text_', 'foo' ),72 raises( AttributeError, READONLY_MESSAGE ) )73 assert_that( calling( ycm_core.Diagnostic().__setattr__ )74 .with_args( 'long_formatted_text_', 'foo' ),75 raises( AttributeError, READONLY_MESSAGE ) )76 assert_that( calling( ycm_core.Diagnostic().__setattr__ )77 .with_args( 'kind_', ycm_core.Diagnostic().kind_.WARNING ),78 raises( AttributeError, READONLY_MESSAGE ) )79 assert_that( calling( ycm_core.DocumentationData().__setattr__ )80 .with_args( 'raw_comment', 'foo' ),81 raises( AttributeError, READONLY_MESSAGE ) )82 assert_that( calling( ycm_core.DocumentationData().__setattr__ )83 .with_args( 'brief_comment', 'foo' ),84 raises( AttributeError, READONLY_MESSAGE ) )85 assert_that( calling( ycm_core.DocumentationData().__setattr__ )86 .with_args( 'canonical_type', 'foo' ),87 raises( AttributeError, READONLY_MESSAGE ) )88 assert_that( calling( ycm_core.DocumentationData().__setattr__ )89 .with_args( 'display_name', 'foo' ),90 raises( AttributeError, READONLY_MESSAGE ) )91 assert_that( calling( ycm_core.DocumentationData().__setattr__ )92 .with_args( 'comment_xml', 'foo' ),93 raises( AttributeError, READONLY_MESSAGE ) )94 db = ycm_core.CompilationDatabase( 'foo' )95 assert_that( calling( db.__setattr__ )96 .with_args( 'database_directory', 'foo' ),97 raises( AttributeError, READONLY_MESSAGE ) )98 compilation_info = db.GetCompilationInfoForFile( 'foo.c' )99 assert_that( calling( compilation_info.__setattr__ )100 .with_args( 'compiler_working_dir_', 'foo' ),101 raises( AttributeError, READONLY_MESSAGE ) )102 assert_that( calling( compilation_info.__setattr__ )103 .with_args( 'compiler_flags_', ycm_core.StringVector() ),104 raises( AttributeError, READONLY_MESSAGE ) )105@ClangOnly106def CppBindings_CompilationInfo_NoInit_test():107 assert_that( calling( ycm_core.CompilationInfoForFile ),108 raises( TypeError, 'ycm_core.CompilationInfoForFile:'109 ' No constructor defined!' ) )110def Dummy_test():111 # Workaround for https://github.com/pytest-dev/pytest-rerunfailures/issues/51...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run PyHamcrest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful