Changeset 10676 for main/waeup.kofa/trunk/src/waeup/kofa/utils/tests
- Timestamp:
- 31 Oct 2013, 17:51:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py
r9689 r10676 492 492 493 493 494 class CheckCSVCharsetTestCase(unittest.TestCase): 495 496 def test_valid_data1(self): 497 csv = ( 498 'col1,col2,col3\n' 499 'val1,val2,val3\n' 500 ).splitlines() 501 self.assertEqual(helpers.check_csv_charset(csv), None) 502 503 def test_valid_data2(self): 504 csv = ( 505 "code,title,title_prefix\n" 506 "FAC1,Faculty 1,faculty\n" 507 "FAC2,Faculty 2,institute\n" 508 "FAC3,Fäcülty 3,school\n" 509 ).splitlines() 510 self.assertEqual(helpers.check_csv_charset(csv), None) 511 512 def test_invalid_data1(self): 513 csv = ( 514 'col1,col2,col3\n' + 515 chr(0x92) + 'val1,val2,val3\n' 516 ).splitlines() 517 self.assertEqual(helpers.check_csv_charset(csv), 1) 518 519 def test_invalid_data2(self): 520 csv = ( 521 'some text that \n' 522 '\n' # this empty line will break 523 'is not a csv file \n' + chr(0x92) + '\n' 524 ).splitlines() 525 self.assertEqual(helpers.check_csv_charset(csv), 2) 494 526 495 527 def test_suite(): … … 509 541 MergeCSVFileTestCase, 510 542 SimpleHelpersTestCase, 543 CheckCSVCharsetTestCase, 511 544 ]: 512 545 suite.addTests(
Note: See TracChangeset for help on using the changeset viewer.