Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157424)

Delta Between Two Patch Sets: Lib/test/test_configparser.py

Issue 16510: Using appropriate checks in tests
Left Patch Set: Created 6 years ago
Right Patch Set: Created 5 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_concurrent_futures.py ('k') | Lib/test/test_copyreg.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 import collections 1 import collections
2 import configparser 2 import configparser
3 import io 3 import io
4 import os 4 import os
5 import sys 5 import sys
6 import textwrap 6 import textwrap
7 import unittest 7 import unittest
8 import warnings 8 import warnings
9 9
10 from test import support 10 from test import support
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 pass 700 pass
701 cf.set("sect", "option1", "splat") 701 cf.set("sect", "option1", "splat")
702 cf.set("sect", "option1", mystr("splat")) 702 cf.set("sect", "option1", mystr("splat"))
703 cf.set("sect", "option2", "splat") 703 cf.set("sect", "option2", "splat")
704 cf.set("sect", "option2", mystr("splat")) 704 cf.set("sect", "option2", mystr("splat"))
705 cf.set("sect", "option1", "splat") 705 cf.set("sect", "option1", "splat")
706 cf.set("sect", "option2", "splat") 706 cf.set("sect", "option2", "splat")
707 707
708 def test_read_returns_file_list(self): 708 def test_read_returns_file_list(self):
709 if self.delimiters[0] != '=': 709 if self.delimiters[0] != '=':
710 # skip reading the file if we're using an incompatible format 710 self.skipTest('incompatible format')
711 return
712 file1 = support.findfile("cfgparser.1") 711 file1 = support.findfile("cfgparser.1")
713 # check when we pass a mix of readable and non-readable files: 712 # check when we pass a mix of readable and non-readable files:
714 cf = self.newconfig() 713 cf = self.newconfig()
715 parsed_files = cf.read([file1, "nonexistent-file"]) 714 parsed_files = cf.read([file1, "nonexistent-file"])
716 self.assertEqual(parsed_files, [file1]) 715 self.assertEqual(parsed_files, [file1])
717 self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") 716 self.assertEqual(cf.get("Foo Bar", "foo"), "newbar")
718 # check when we pass only a filename: 717 # check when we pass only a filename:
719 cf = self.newconfig() 718 cf = self.newconfig()
720 parsed_files = cf.read(file1) 719 parsed_files = cf.read(file1)
721 self.assertEqual(parsed_files, [file1]) 720 self.assertEqual(parsed_files, [file1])
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 self.assertEqual(s['k6'], 'v6;still v6; and still v6') 1759 self.assertEqual(s['k6'], 'v6;still v6; and still v6')
1761 self.assertEqual(s['k7'], 'v7;still v7; and still v7') 1760 self.assertEqual(s['k7'], 'v7;still v7; and still v7')
1762 s = cfg['multiprefix'] 1761 s = cfg['multiprefix']
1763 self.assertEqual(s['k1'], 'v1;still v1') 1762 self.assertEqual(s['k1'], 'v1;still v1')
1764 self.assertEqual(s['k2'], 'v2') 1763 self.assertEqual(s['k2'], 'v2')
1765 self.assertEqual(s['k3'], 'v3;#//still v3# and still v3') 1764 self.assertEqual(s['k3'], 'v3;#//still v3# and still v3')
1766 1765
1767 1766
1768 if __name__ == '__main__': 1767 if __name__ == '__main__':
1769 unittest.main() 1768 unittest.main()
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+