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
a7a34a83
Kaydet (Commit)
a7a34a83
authored
Kas 16, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #19590: Use specific asserts in email tests.
üst
2335de7a
328cf3cb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
test_defect_handling.py
Lib/test/test_email/test_defect_handling.py
+13
-13
test_email.py
Lib/test/test_email/test_email.py
+0
-0
test_parser.py
Lib/test/test_email/test_parser.py
+2
-2
test_utils.py
Lib/test/test_email/test_utils.py
+2
-2
No files found.
Lib/test/test_email/test_defect_handling.py
Dosyayı görüntüle @
a7a34a83
...
...
@@ -59,8 +59,8 @@ class TestDefectsBase:
inner
=
msg
.
get_payload
(
0
)
self
.
assertTrue
(
hasattr
(
inner
,
'defects'
))
self
.
assertEqual
(
len
(
self
.
get_defects
(
inner
)),
1
)
self
.
assert
True
(
isi
nstance
(
self
.
get_defects
(
inner
)[
0
],
errors
.
StartBoundaryNotFoundDefect
)
)
self
.
assert
IsI
nstance
(
self
.
get_defects
(
inner
)[
0
],
errors
.
StartBoundaryNotFoundDefect
)
def
test_multipart_no_boundary
(
self
):
source
=
textwrap
.
dedent
(
"""
\
...
...
@@ -84,12 +84,12 @@ class TestDefectsBase:
with
self
.
_raise_point
(
errors
.
NoBoundaryInMultipartDefect
):
msg
=
self
.
_str_msg
(
source
)
if
self
.
raise_expected
:
return
self
.
assert
True
(
isinstance
(
msg
.
get_payload
(),
str
)
)
self
.
assert
IsInstance
(
msg
.
get_payload
(),
str
)
self
.
assertEqual
(
len
(
self
.
get_defects
(
msg
)),
2
)
self
.
assert
True
(
isi
nstance
(
self
.
get_defects
(
msg
)[
0
],
errors
.
NoBoundaryInMultipartDefect
)
)
self
.
assert
True
(
isi
nstance
(
self
.
get_defects
(
msg
)[
1
],
errors
.
MultipartInvariantViolationDefect
)
)
self
.
assert
IsI
nstance
(
self
.
get_defects
(
msg
)[
0
],
errors
.
NoBoundaryInMultipartDefect
)
self
.
assert
IsI
nstance
(
self
.
get_defects
(
msg
)[
1
],
errors
.
MultipartInvariantViolationDefect
)
multipart_msg
=
textwrap
.
dedent
(
"""
\
Date: Wed, 14 Nov 2007 12:56:23 GMT
...
...
@@ -153,10 +153,10 @@ class TestDefectsBase:
if
self
.
raise_expected
:
return
self
.
assertTrue
(
hasattr
(
msg
,
'defects'
))
self
.
assertEqual
(
len
(
self
.
get_defects
(
msg
)),
2
)
self
.
assert
True
(
isi
nstance
(
self
.
get_defects
(
msg
)[
0
],
errors
.
NoBoundaryInMultipartDefect
)
)
self
.
assert
True
(
isi
nstance
(
self
.
get_defects
(
msg
)[
1
],
errors
.
MultipartInvariantViolationDefect
)
)
self
.
assert
IsI
nstance
(
self
.
get_defects
(
msg
)[
0
],
errors
.
NoBoundaryInMultipartDefect
)
self
.
assert
IsI
nstance
(
self
.
get_defects
(
msg
)[
1
],
errors
.
MultipartInvariantViolationDefect
)
def
test_missing_start_boundary
(
self
):
source
=
textwrap
.
dedent
(
"""
\
...
...
@@ -193,8 +193,8 @@ class TestDefectsBase:
if
self
.
raise_expected
:
return
bad
=
outer
.
get_payload
(
1
)
.
get_payload
(
0
)
self
.
assertEqual
(
len
(
self
.
get_defects
(
bad
)),
1
)
self
.
assert
True
(
isi
nstance
(
self
.
get_defects
(
bad
)[
0
],
errors
.
StartBoundaryNotFoundDefect
)
)
self
.
assert
IsI
nstance
(
self
.
get_defects
(
bad
)[
0
],
errors
.
StartBoundaryNotFoundDefect
)
def
test_first_line_is_continuation_header
(
self
):
with
self
.
_raise_point
(
errors
.
FirstHeaderLineIsContinuationDefect
):
...
...
Lib/test/test_email/test_email.py
Dosyayı görüntüle @
a7a34a83
This diff is collapsed.
Click to expand it.
Lib/test/test_email/test_parser.py
Dosyayı görüntüle @
a7a34a83
...
...
@@ -18,7 +18,7 @@ class TestCustomMessage(TestEmailBase):
msg
=
email
.
message_from_string
(
"Subject: bogus
\n\n
msg
\n
"
,
self
.
MyMessage
,
policy
=
self
.
MyPolicy
)
self
.
assert
True
(
isinstance
(
msg
,
self
.
MyMessage
)
)
self
.
assert
IsInstance
(
msg
,
self
.
MyMessage
)
self
.
assertIs
(
msg
.
check_policy
,
self
.
MyPolicy
)
def
test_custom_message_gets_policy_if_possible_from_file
(
self
):
...
...
@@ -26,7 +26,7 @@ class TestCustomMessage(TestEmailBase):
msg
=
email
.
message_from_file
(
source_file
,
self
.
MyMessage
,
policy
=
self
.
MyPolicy
)
self
.
assert
True
(
isinstance
(
msg
,
self
.
MyMessage
)
)
self
.
assert
IsInstance
(
msg
,
self
.
MyMessage
)
self
.
assertIs
(
msg
.
check_policy
,
self
.
MyPolicy
)
# XXX add tests for other functions that take Message arg.
...
...
Lib/test/test_email/test_utils.py
Dosyayı görüntüle @
a7a34a83
...
...
@@ -54,12 +54,12 @@ class LocaltimeTests(unittest.TestCase):
def
test_localtime_is_tz_aware_daylight_true
(
self
):
test
.
support
.
patch
(
self
,
time
,
'daylight'
,
True
)
t
=
utils
.
localtime
()
self
.
assertIsNot
(
t
.
tzinfo
,
None
)
self
.
assertIsNot
None
(
t
.
tzinfo
)
def
test_localtime_is_tz_aware_daylight_false
(
self
):
test
.
support
.
patch
(
self
,
time
,
'daylight'
,
False
)
t
=
utils
.
localtime
()
self
.
assertIsNot
(
t
.
tzinfo
,
None
)
self
.
assertIsNot
None
(
t
.
tzinfo
)
def
test_localtime_daylight_true_dst_false
(
self
):
test
.
support
.
patch
(
self
,
time
,
'daylight'
,
True
)
...
...
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