Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
dc1fa80b
Kaydet (Commit)
dc1fa80b
authored
Ock 11, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#16925: test_configparser now works with unittest test discovery. Patch by Zachary Ware.
üst
5d3dba0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
35 deletions
+16
-35
test_configparser.py
Lib/test/test_configparser.py
+13
-35
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_configparser.py
Dosyayı görüntüle @
dc1fa80b
...
@@ -32,7 +32,7 @@ class SortedDict(collections.UserDict):
...
@@ -32,7 +32,7 @@ class SortedDict(collections.UserDict):
__iter__
=
iterkeys
__iter__
=
iterkeys
class
CfgParserTestCaseClass
(
unittest
.
TestCase
)
:
class
CfgParserTestCaseClass
:
allow_no_value
=
False
allow_no_value
=
False
delimiters
=
(
'='
,
':'
)
delimiters
=
(
'='
,
':'
)
comment_prefixes
=
(
';'
,
'#'
)
comment_prefixes
=
(
';'
,
'#'
)
...
@@ -830,12 +830,12 @@ boolean {0[0]} NO
...
@@ -830,12 +830,12 @@ boolean {0[0]} NO
self
.
assertEqual
(
cf
.
sections
(),
[
'section1'
,
'section2'
,
'section3'
])
self
.
assertEqual
(
cf
.
sections
(),
[
'section1'
,
'section2'
,
'section3'
])
class
StrictTestCase
(
BasicTestCase
):
class
StrictTestCase
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
RawConfigParser
config_class
=
configparser
.
RawConfigParser
strict
=
True
strict
=
True
class
ConfigParserTestCase
(
BasicTestCase
):
class
ConfigParserTestCase
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
ConfigParser
config_class
=
configparser
.
ConfigParser
def
test_interpolation
(
self
):
def
test_interpolation
(
self
):
...
@@ -924,7 +924,7 @@ class ConfigParserTestCase(BasicTestCase):
...
@@ -924,7 +924,7 @@ class ConfigParserTestCase(BasicTestCase):
self
.
assertRaises
(
ValueError
,
cf
.
add_section
,
self
.
default_section
)
self
.
assertRaises
(
ValueError
,
cf
.
add_section
,
self
.
default_section
)
class
ConfigParserTestCaseNoInterpolation
(
BasicTestCase
):
class
ConfigParserTestCaseNoInterpolation
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
ConfigParser
config_class
=
configparser
.
ConfigParser
interpolation
=
None
interpolation
=
None
ini
=
textwrap
.
dedent
(
"""
ini
=
textwrap
.
dedent
(
"""
...
@@ -989,7 +989,7 @@ class ConfigParserTestCaseNonStandardDelimiters(ConfigParserTestCase):
...
@@ -989,7 +989,7 @@ class ConfigParserTestCaseNonStandardDelimiters(ConfigParserTestCase):
class
ConfigParserTestCaseNonStandardDefaultSection
(
ConfigParserTestCase
):
class
ConfigParserTestCaseNonStandardDefaultSection
(
ConfigParserTestCase
):
default_section
=
'general'
default_section
=
'general'
class
MultilineValuesTestCase
(
BasicTestCase
):
class
MultilineValuesTestCase
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
ConfigParser
config_class
=
configparser
.
ConfigParser
wonderful_spam
=
(
"I'm having spam spam spam spam "
wonderful_spam
=
(
"I'm having spam spam spam spam "
"spam spam spam beaked beans spam "
"spam spam spam beaked beans spam "
...
@@ -1017,7 +1017,7 @@ class MultilineValuesTestCase(BasicTestCase):
...
@@ -1017,7 +1017,7 @@ class MultilineValuesTestCase(BasicTestCase):
self
.
assertEqual
(
cf_from_file
.
get
(
'section8'
,
'lovely_spam4'
),
self
.
assertEqual
(
cf_from_file
.
get
(
'section8'
,
'lovely_spam4'
),
self
.
wonderful_spam
.
replace
(
'
\t\n
'
,
'
\n
'
))
self
.
wonderful_spam
.
replace
(
'
\t\n
'
,
'
\n
'
))
class
RawConfigParserTestCase
(
BasicTestCase
):
class
RawConfigParserTestCase
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
RawConfigParser
config_class
=
configparser
.
RawConfigParser
def
test_interpolation
(
self
):
def
test_interpolation
(
self
):
...
@@ -1064,7 +1064,7 @@ class RawConfigParserTestCaseNonStandardDelimiters(RawConfigParserTestCase):
...
@@ -1064,7 +1064,7 @@ class RawConfigParserTestCaseNonStandardDelimiters(RawConfigParserTestCase):
comment_prefixes
=
(
'//'
,
'"'
)
comment_prefixes
=
(
'//'
,
'"'
)
inline_comment_prefixes
=
(
'//'
,
'"'
)
inline_comment_prefixes
=
(
'//'
,
'"'
)
class
RawConfigParserTestSambaConf
(
CfgParserTestCaseClass
):
class
RawConfigParserTestSambaConf
(
CfgParserTestCaseClass
,
unittest
.
TestCase
):
config_class
=
configparser
.
RawConfigParser
config_class
=
configparser
.
RawConfigParser
comment_prefixes
=
(
'#'
,
';'
,
'----'
)
comment_prefixes
=
(
'#'
,
';'
,
'----'
)
inline_comment_prefixes
=
(
'//'
,)
inline_comment_prefixes
=
(
'//'
,)
...
@@ -1084,7 +1084,7 @@ class RawConfigParserTestSambaConf(CfgParserTestCaseClass):
...
@@ -1084,7 +1084,7 @@ class RawConfigParserTestSambaConf(CfgParserTestCaseClass):
self
.
assertEqual
(
cf
.
get
(
"global"
,
"hosts allow"
),
"127."
)
self
.
assertEqual
(
cf
.
get
(
"global"
,
"hosts allow"
),
"127."
)
self
.
assertEqual
(
cf
.
get
(
"tmp"
,
"echo command"
),
"cat
%
s; rm
%
s"
)
self
.
assertEqual
(
cf
.
get
(
"tmp"
,
"echo command"
),
"cat
%
s; rm
%
s"
)
class
ConfigParserTestCaseExtendedInterpolation
(
BasicTestCase
):
class
ConfigParserTestCaseExtendedInterpolation
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
ConfigParser
config_class
=
configparser
.
ConfigParser
interpolation
=
configparser
.
ExtendedInterpolation
()
interpolation
=
configparser
.
ExtendedInterpolation
()
default_section
=
'common'
default_section
=
'common'
...
@@ -1258,7 +1258,7 @@ class ConfigParserTestCaseExtendedInterpolation(BasicTestCase):
...
@@ -1258,7 +1258,7 @@ class ConfigParserTestCaseExtendedInterpolation(BasicTestCase):
class
ConfigParserTestCaseNoValue
(
ConfigParserTestCase
):
class
ConfigParserTestCaseNoValue
(
ConfigParserTestCase
):
allow_no_value
=
True
allow_no_value
=
True
class
ConfigParserTestCaseTrickyFile
(
CfgParserTestCaseClass
):
class
ConfigParserTestCaseTrickyFile
(
CfgParserTestCaseClass
,
unittest
.
TestCase
):
config_class
=
configparser
.
ConfigParser
config_class
=
configparser
.
ConfigParser
delimiters
=
{
'='
}
delimiters
=
{
'='
}
comment_prefixes
=
{
'#'
}
comment_prefixes
=
{
'#'
}
...
@@ -1355,7 +1355,7 @@ class SortedTestCase(RawConfigParserTestCase):
...
@@ -1355,7 +1355,7 @@ class SortedTestCase(RawConfigParserTestCase):
"o4 = 1
\n\n
"
)
"o4 = 1
\n\n
"
)
class
CompatibleTestCase
(
CfgParserTestCaseClass
):
class
CompatibleTestCase
(
CfgParserTestCaseClass
,
unittest
.
TestCase
):
config_class
=
configparser
.
RawConfigParser
config_class
=
configparser
.
RawConfigParser
comment_prefixes
=
'#;'
comment_prefixes
=
'#;'
inline_comment_prefixes
=
';'
inline_comment_prefixes
=
';'
...
@@ -1377,7 +1377,7 @@ class CompatibleTestCase(CfgParserTestCaseClass):
...
@@ -1377,7 +1377,7 @@ class CompatibleTestCase(CfgParserTestCaseClass):
self
.
assertEqual
(
cf
.
get
(
'Commented Bar'
,
'quirk'
),
self
.
assertEqual
(
cf
.
get
(
'Commented Bar'
,
'quirk'
),
'this;is not a comment'
)
'this;is not a comment'
)
class
CopyTestCase
(
BasicTestCase
):
class
CopyTestCase
(
BasicTestCase
,
unittest
.
TestCase
):
config_class
=
configparser
.
ConfigParser
config_class
=
configparser
.
ConfigParser
def
fromstring
(
self
,
string
,
defaults
=
None
):
def
fromstring
(
self
,
string
,
defaults
=
None
):
...
@@ -1713,27 +1713,5 @@ class InlineCommentStrippingTestCase(unittest.TestCase):
...
@@ -1713,27 +1713,5 @@ class InlineCommentStrippingTestCase(unittest.TestCase):
self
.
assertEqual
(
s
[
'k3'
],
'v3;#//still v3# and still v3'
)
self
.
assertEqual
(
s
[
'k3'
],
'v3;#//still v3# and still v3'
)
def
test_main
():
if
__name__
==
'__main__'
:
support
.
run_unittest
(
unittest
.
main
()
ConfigParserTestCase
,
ConfigParserTestCaseNonStandardDelimiters
,
ConfigParserTestCaseNoValue
,
ConfigParserTestCaseExtendedInterpolation
,
ConfigParserTestCaseLegacyInterpolation
,
ConfigParserTestCaseNoInterpolation
,
ConfigParserTestCaseTrickyFile
,
MultilineValuesTestCase
,
RawConfigParserTestCase
,
RawConfigParserTestCaseNonStandardDelimiters
,
RawConfigParserTestSambaConf
,
SortedTestCase
,
Issue7005TestCase
,
StrictTestCase
,
CompatibleTestCase
,
CopyTestCase
,
ConfigParserTestCaseNonStandardDefaultSection
,
ReadFileTestCase
,
CoverageOneHundredTestCase
,
ExceptionPicklingTestCase
,
InlineCommentStrippingTestCase
,
)
Misc/NEWS
Dosyayı görüntüle @
dc1fa80b
...
@@ -421,6 +421,9 @@ Library
...
@@ -421,6 +421,9 @@ Library
Tests
Tests
-----
-----
- Issue #16925: test_configparser now works with unittest test discovery.
Patch by Zachary Ware.
- Issue #16918: test_codecs now works with unittest test discovery.
- Issue #16918: test_codecs now works with unittest test discovery.
Patch by Zachary Ware.
Patch by Zachary Ware.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment