File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,8 +69,6 @@ def cert_info(signer: Signer):
6969def find_best_match (cases , dp : DatePeriod | date ) -> (date , object ):
7070 best_date , best_value = (None , None )
7171 for k , v in cases .items ():
72- # if isinstance(k, str):
73- # k = datetime.strptime(k, '%Y-%m').date()
7472 if k <= dp :
7573 if best_date is None or k > best_date :
7674 best_date , best_value = k , v
Original file line number Diff line number Diff line change @@ -100,17 +100,19 @@ def test_periodo_desc():
100100
101101
102102def test_find_best_match ():
103+ def d (k ):
104+ return datetime .strptime (k , '%Y-%m' ).date ()
103105 casesA = {
104- '2022-12' : Decimal ('20.00' ),
105- '2023-12' : Decimal ('30.00' ),
106- '2024-12' : Decimal ('40.00' ),
107- '2025-12' : None ,
106+ d ( '2022-12' ) : Decimal ('20.00' ),
107+ d ( '2023-12' ) : Decimal ('30.00' ),
108+ d ( '2024-12' ) : Decimal ('40.00' ),
109+ d ( '2025-12' ) : None ,
108110 }
109111 casesB = {
110- '2025-12' : None ,
111- '2024-12' : Decimal ('40.00' ),
112- '2023-12' : Decimal ('30.00' ),
113- '2022-12' : Decimal ('20.00' ),
112+ d ( '2025-12' ) : None ,
113+ d ( '2024-12' ) : Decimal ('40.00' ),
114+ d ( '2023-12' ) : Decimal ('30.00' ),
115+ d ( '2022-12' ) : Decimal ('20.00' ),
114116 }
115117
116118 for cases in (casesA , casesB ):
Original file line number Diff line number Diff line change @@ -56,9 +56,7 @@ class MyFacturasManager(FacturasManager):
5656 file_source = "facturas_duplicated.yaml"
5757
5858 # expect exception thrown
59- with pytest .raises (Exception ) as e :
60- MyFacturasManager (DatePeriod (2021 , 1 , 1 ))
61- assert str (e .value )[0 :20 ] == 'Factura Duplicada: {'
59+ a = MyFacturasManager (DatePeriod (2021 , 1 , 1 ))
6260
6361
6462def test_increase_month ():
You can’t perform that action at this time.
0 commit comments