used python unittest for the tests
This commit is contained in:
		
							parent
							
								
									819d0d0696
								
							
						
					
					
						commit
						4df6ba75a2
					
				| @ -1,4 +1,4 @@ | |||||||
| """Test parsing of a DSMR v2.2 telegram.""" | import unittest | ||||||
| 
 | 
 | ||||||
| from dsmr_parser.parsers import TelegramParserV2_2 | from dsmr_parser.parsers import TelegramParserV2_2 | ||||||
| from dsmr_parser import telegram_specifications | from dsmr_parser import telegram_specifications | ||||||
| @ -28,9 +28,10 @@ TELEGRAM_V2_2 = [ | |||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_parse(): | class TelegramParserV2_2Test(unittest.TestCase): | ||||||
|     """Test if telegram parsing results in correct results.""" |     """ Test parsing of a DSMR v2.2 telegram. """ | ||||||
| 
 | 
 | ||||||
|  |     def test_parse(self): | ||||||
|         parser = TelegramParserV2_2(telegram_specifications.V2_2) |         parser = TelegramParserV2_2(telegram_specifications.V2_2) | ||||||
|         result = parser.parse(TELEGRAM_V2_2) |         result = parser.parse(TELEGRAM_V2_2) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| """Test parsing of a DSMR v4.2 telegram.""" |  | ||||||
| import datetime |  | ||||||
| from decimal import Decimal | from decimal import Decimal | ||||||
|  | import datetime | ||||||
|  | import unittest | ||||||
| 
 | 
 | ||||||
| import pytz | import pytz | ||||||
| 
 | 
 | ||||||
| @ -47,8 +47,10 @@ TELEGRAM_V4_2 = [ | |||||||
|     '!5D83', |     '!5D83', | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
|  | class TelegramParserV4_2Test(unittest.TestCase): | ||||||
|  |     """ Test parsing of a DSMR v4.2 telegram. """ | ||||||
| 
 | 
 | ||||||
| def test_parse(): |     def test_parse(self): | ||||||
|         parser = TelegramParser(telegram_specifications.V4) |         parser = TelegramParser(telegram_specifications.V4) | ||||||
|         result = parser.parse(TELEGRAM_V4_2) |         result = parser.parse(TELEGRAM_V4_2) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user