kyu_6.help_the_bookseller package
Submodules
kyu_6.help_the_bookseller.stock_list module
Solution for -> Help the bookseller!.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_6.help_the_bookseller.stock_list.stock_list(list_of_art: list, list_of_cat: list) str[source]
Stock list function.
You will be given a stockist (e.g. : L) and a list of categories in capital letters e.g : M = {“A”, “B”, “C”, “W”} M = [“A”, “B”, “C”, “W”]
and your task is to find all the books of L with codes belonging to each category of M and to sum their quantity according to each category.
- Parameters:
list_of_art – list
list_of_cat – list
- Returns:
string
kyu_6.help_the_bookseller.test_stock_list module
Test for -> Help the bookseller!.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_6.help_the_bookseller.test_stock_list.StockListTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting stock_list function.
- _classSetupFailed = False
- _class_cleanups = []
- test_stock_list = None
- test_stock_list_0(**kw)
Testing stock_list function with various test data [with list_of_art=[‘ABAR 200’, ‘CDXE 500’, ‘BKWR 250’, ‘BTSQ 890’, ‘DRTY 600’], list_of_cat=[‘A’, ‘B’], expected=’(A : 200) - (B : 1140)’].
- Returns:
- test_stock_list_1(**kw)
Testing stock_list function with various test data [with list_of_art=[‘BBAR 150’, ‘CDXE 515’, ‘BKWR 250’, ‘BTSQ 890’, ‘DRTY 600’], list_of_cat=[‘A’, ‘B’, ‘C’, ‘D’], expected=’(A : 0) - (B : 1290) - (C : 515) - (D : 600)’].
- Returns:
- test_stock_list_2(**kw)
Testing stock_list function with various test data [with list_of_art=[‘CBART 20’, ‘CDXEF 50’, ‘BKWRK 25’, ‘BTSQZ 89’, ‘DRTYM 60’], list_of_cat=[‘A’, ‘B’, ‘C’, ‘W’], expected=’(A : 0) - (B : 114) - (C : 70) - (W : 0)’].
- Returns:
- test_stock_list_3(**kw)
Testing stock_list function with various test data [with list_of_art=[‘ROXANNE 102’, ‘RHODODE 123’, ‘…’, ‘BTSQZFG 239’, ‘DRTYMKH 060’], list_of_cat=[‘B’, ‘R’, ‘D’, ‘X’], expected=’(B : 364) - (R : 225) - (D : 60) - (X : 0)’].
- Returns:
- test_stock_list_4(**kw)
Testing stock_list function with various test data [with list_of_art=[‘ROXANNE 102’, ‘RHODODE 123’, ‘…’, ‘BTSQZFG 239’, ‘DRTYMKH 060’], list_of_cat=[‘U’, ‘V’, ‘R’], expected=’(U : 0) - (V : 0) - (R : 225)’].
- Returns:
- test_stock_list_5(**kw)
Testing stock_list function with various test data [with list_of_art=[], list_of_cat=[‘B’, ‘R’, ‘D’, ‘X’], expected=’’].
- Returns:
- test_stock_list_6(**kw)
Testing stock_list function with various test data [with list_of_art=[‘BKWRK 125’, ‘BTSQZ 239’, ‘BBART 350’, ‘DRTYM 060’], list_of_cat=[‘B’, ‘D’], expected=’(B : 714) - (D : 60)’].
- Returns:
Module contents
Help the bookseller.