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
b4f3d80d
Kaydet (Commit)
b4f3d80d
authored
Kas 07, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backported tests for issue #22406.
üst
4535b111
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
test_codecs.py
Lib/test/test_codecs.py
+4
-0
test_uu.py
Lib/test/test_uu.py
+20
-0
No files found.
Lib/test/test_codecs.py
Dosyayı görüntüle @
b4f3d80d
...
@@ -2109,6 +2109,10 @@ def test_main():
...
@@ -2109,6 +2109,10 @@ def test_main():
BomTest
,
BomTest
,
)
)
def
test_uu_invalid
(
self
):
# Missing "begin" line
self
.
assertRaises
(
ValueError
,
codecs
.
decode
,
""
,
"uu-codec"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_main
()
test_main
()
Lib/test/test_uu.py
Dosyayı görüntüle @
b4f3d80d
...
@@ -61,6 +61,26 @@ class UUTest(unittest.TestCase):
...
@@ -61,6 +61,26 @@ class UUTest(unittest.TestCase):
except
uu
.
Error
,
e
:
except
uu
.
Error
,
e
:
self
.
assertEqual
(
str
(
e
),
"No valid begin line found in input file"
)
self
.
assertEqual
(
str
(
e
),
"No valid begin line found in input file"
)
def
test_garbage_padding
(
self
):
# Issue #22406
encodedtext
=
(
"begin 644 file
\n
"
# length 1; bits 001100 111111 111111 111111
"
\x21\x2C\x5F\x5F\x5F\n
"
"
\x20\n
"
"end
\n
"
)
plaintext
=
"
\x33
"
# 00110011
inp
=
cStringIO
.
StringIO
(
encodedtext
)
out
=
cStringIO
.
StringIO
()
uu
.
decode
(
inp
,
out
,
quiet
=
True
)
self
.
assertEqual
(
out
.
getvalue
(),
plaintext
)
import
codecs
decoded
=
codecs
.
decode
(
encodedtext
,
"uu_codec"
)
self
.
assertEqual
(
decoded
,
plaintext
)
class
UUStdIOTest
(
unittest
.
TestCase
):
class
UUStdIOTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
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