kyu_7.fill_the_hard_disk_drive package
Submodules
kyu_7.fill_the_hard_disk_drive.save module
Solution for -> Computer problem series #1: Fill the Hard Disk Drive.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_7.fill_the_hard_disk_drive.save.save(sizes: list, hd: int) int[source]
‘save’ function.
Your task is to determine how many files of the copy queue you will be able to save into your Hard Disk Drive.
Input: Array of file sizes (0 <= s <= 100) Capacity of the HD (0 <= c <= 500)
Output: Number of files that can be fully saved in the HD
- Parameters:
sizes – list
hd – int
- Returns:
int
kyu_7.fill_the_hard_disk_drive.test_save module
Test for -> Computer problem series #1: Fill the Hard Disk Drive.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_7.fill_the_hard_disk_drive.test_save.SaveTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting ‘save’ function.
- _classSetupFailed = False
- _class_cleanups = []
- test_save_negative = None
- test_save_negative_0(**kw)
Testing ‘save’ function: negative [with sizes=[11, 13, 15, 17, 19], hd=8, expected=0].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_negative_1(**kw)
Testing ‘save’ function: negative [with sizes=[45], hd=12, expected=0].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_positive = None
- test_save_positive_0(**kw)
Testing ‘save’ function: positive [with sizes=[4, 4, 4, 3, 3], hd=12, expected=3].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_positive_1(**kw)
Testing ‘save’ function: positive [with sizes=[4, 4, 4, 3, 3], hd=11, expected=2].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_positive_2(**kw)
Testing ‘save’ function: positive [with sizes=[4, 8, 15, 16, 23, 42], hd=108, expected=6].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_positive_3(**kw)
Testing ‘save’ function: positive [with sizes=[13], hd=13, expected=1].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_positive_4(**kw)
Testing ‘save’ function: positive [with sizes=[1, 2, 3, 4], hd=250, expected=4].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
- test_save_positive_5(**kw)
Testing ‘save’ function: positive [with sizes=[100], hd=500, expected=1].
The function should determine how many files of the copy queue you will be able to save into your Hard Disk Drive. :return:
Module contents
Computer problem series #1.