Skip to content

Commit

Permalink
Added test for PM readings
Browse files Browse the repository at this point in the history
  • Loading branch information
mroig committed Aug 11, 2017
1 parent f1fc261 commit 8d32d54
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,28 @@ def test_agrupar_i_obtenir_dates(self):
self.assertEqual(data_inici, '2017-03-31')
self.assertEqual(data_fi, '2017-04-30')

def test_agrupar_i_obtenir_dates_maximetre(self):
f1 = F1(self.xml_f101_atr_invoice_30A)
f1.parse_xml()

fact = f1.facturas_atr[0]
compt = fact.get_comptadors()[0]
lectures = compt.get_lectures()

lectures_agrupades = agrupar_lectures_per_data(lectures)

self.assertEqual(
lectures_agrupades.keys(),
[
('2017-03-31', '2017-04-17'), # Energy readings
('2017-04-30', '2017-04-30') # Maximeter readings
]
)

data_inici, data_fi = obtenir_data_inici_i_final(lectures_agrupades)
self.assertEqual(data_inici, '2017-03-31')
self.assertEqual(data_fi, '2017-04-30')

def test_spaces_are_deleted(self):
f1 = F1(self.xml_f101_spaces)
f1.parse_xml()
Expand Down

0 comments on commit 8d32d54

Please sign in to comment.