(self)
| 3815 | self.assertRaises(ValueError, self.apply_config, self.custom_formatter_with_defaults) |
| 3816 | |
| 3817 | def test_baseconfig(self): |
| 3818 | d = { |
| 3819 | 'atuple': (1, 2, 3), |
| 3820 | 'alist': ['a', 'b', 'c'], |
| 3821 | 'adict': { |
| 3822 | 'd': 'e', 'f': 3 , |
| 3823 | 'alpha numeric 1 with spaces' : 5, |
| 3824 | 'alpha numeric 1 %( - © ©ß¯' : 9, |
| 3825 | 'alpha numeric ] 1 with spaces' : 15, |
| 3826 | 'alpha ]] numeric 1 %( - © ©ß¯]' : 19, |
| 3827 | ' alpha [ numeric 1 %( - © ©ß¯] ' : 11, |
| 3828 | ' alpha ' : 32, |
| 3829 | '' : 10, |
| 3830 | 'nest4' : { |
| 3831 | 'd': 'e', 'f': 3 , |
| 3832 | 'alpha numeric 1 with spaces' : 5, |
| 3833 | 'alpha numeric 1 %( - © ©ß¯' : 9, |
| 3834 | '' : 10, |
| 3835 | 'somelist' : ('g', ('h', 'i'), 'j'), |
| 3836 | 'somedict' : { |
| 3837 | 'a' : 1, |
| 3838 | 'a with 1 and space' : 3, |
| 3839 | 'a with ( and space' : 4, |
| 3840 | } |
| 3841 | } |
| 3842 | }, |
| 3843 | 'nest1': ('g', ('h', 'i'), 'j'), |
| 3844 | 'nest2': ['k', ['l', 'm'], 'n'], |
| 3845 | 'nest3': ['o', 'cfg://alist', 'p'], |
| 3846 | } |
| 3847 | bc = logging.config.BaseConfigurator(d) |
| 3848 | self.assertEqual(bc.convert('cfg://atuple[1]'), 2) |
| 3849 | self.assertEqual(bc.convert('cfg://alist[1]'), 'b') |
| 3850 | self.assertEqual(bc.convert('cfg://nest1[1][0]'), 'h') |
| 3851 | self.assertEqual(bc.convert('cfg://nest2[1][1]'), 'm') |
| 3852 | self.assertEqual(bc.convert('cfg://adict.d'), 'e') |
| 3853 | self.assertEqual(bc.convert('cfg://adict[f]'), 3) |
| 3854 | self.assertEqual(bc.convert('cfg://adict[alpha numeric 1 with spaces]'), 5) |
| 3855 | self.assertEqual(bc.convert('cfg://adict[alpha numeric 1 %( - © ©ß¯]'), 9) |
| 3856 | self.assertEqual(bc.convert('cfg://adict[]'), 10) |
| 3857 | self.assertEqual(bc.convert('cfg://adict.nest4.d'), 'e') |
| 3858 | self.assertEqual(bc.convert('cfg://adict.nest4[d]'), 'e') |
| 3859 | self.assertEqual(bc.convert('cfg://adict[nest4].d'), 'e') |
| 3860 | self.assertEqual(bc.convert('cfg://adict[nest4][f]'), 3) |
| 3861 | self.assertEqual(bc.convert('cfg://adict[nest4][alpha numeric 1 with spaces]'), 5) |
| 3862 | self.assertEqual(bc.convert('cfg://adict[nest4][alpha numeric 1 %( - © ©ß¯]'), 9) |
| 3863 | self.assertEqual(bc.convert('cfg://adict[nest4][]'), 10) |
| 3864 | self.assertEqual(bc.convert('cfg://adict[nest4][somelist][0]'), 'g') |
| 3865 | self.assertEqual(bc.convert('cfg://adict[nest4][somelist][1][0]'), 'h') |
| 3866 | self.assertEqual(bc.convert('cfg://adict[nest4][somelist][1][1]'), 'i') |
| 3867 | self.assertEqual(bc.convert('cfg://adict[nest4][somelist][2]'), 'j') |
| 3868 | self.assertEqual(bc.convert('cfg://adict[nest4].somedict.a'), 1) |
| 3869 | self.assertEqual(bc.convert('cfg://adict[nest4].somedict[a]'), 1) |
| 3870 | self.assertEqual(bc.convert('cfg://adict[nest4].somedict[a with 1 and space]'), 3) |
| 3871 | self.assertEqual(bc.convert('cfg://adict[nest4].somedict[a with ( and space]'), 4) |
| 3872 | self.assertEqual(bc.convert('cfg://adict.nest4.somelist[1][1]'), 'i') |
| 3873 | self.assertEqual(bc.convert('cfg://adict.nest4.somelist[2]'), 'j') |
| 3874 | self.assertEqual(bc.convert('cfg://adict.nest4.somedict.a'), 1) |
nothing calls this directly
no test coverage detected