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
78751f8e
Kaydet (Commit)
78751f8e
authored
Tem 25, 2015
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #24279: Update test_base64 to use test.support.script_helper.
Initial patch by Christie.
üst
80287698
00f81975
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
test_base64.py
Lib/test/test_base64.py
+9
-17
No files found.
Lib/test/test_base64.py
Dosyayı görüntüle @
78751f8e
...
...
@@ -3,10 +3,8 @@ from test import support
import
base64
import
binascii
import
os
import
sys
import
subprocess
import
struct
from
array
import
array
from
test.support
import
script_helper
class
LegacyBase64TestCase
(
unittest
.
TestCase
):
...
...
@@ -622,15 +620,13 @@ class BaseXYTestCase(unittest.TestCase):
self
.
assertTrue
(
issubclass
(
binascii
.
Error
,
ValueError
))
class
TestMain
(
unittest
.
TestCase
):
def
tearDown
(
self
):
if
os
.
path
.
exists
(
support
.
TESTFN
):
os
.
unlink
(
support
.
TESTFN
)
def
get_output
(
self
,
*
args
,
**
options
):
args
=
(
sys
.
executable
,
'-m'
,
'base64'
)
+
args
return
subprocess
.
check_output
(
args
,
**
options
)
def
get_output
(
self
,
*
args
):
return
script_helper
.
assert_python_ok
(
'-m'
,
'base64'
,
*
args
)
.
out
def
test_encode_decode
(
self
):
output
=
self
.
get_output
(
'-t'
)
...
...
@@ -643,13 +639,14 @@ class TestMain(unittest.TestCase):
def
test_encode_file
(
self
):
with
open
(
support
.
TESTFN
,
'wb'
)
as
fp
:
fp
.
write
(
b
'a
\xff
b
\n
'
)
output
=
self
.
get_output
(
'-e'
,
support
.
TESTFN
)
self
.
assertEqual
(
output
.
rstrip
(),
b
'Yf9iCg=='
)
with
open
(
support
.
TESTFN
,
'rb'
)
as
fp
:
output
=
self
.
get_output
(
'-e'
,
stdin
=
fp
)
self
.
assertEqual
(
output
.
rstrip
(),
b
'Yf9iCg=='
)
def
test_encode_from_stdin
(
self
):
with
script_helper
.
spawn_python
(
'-m'
,
'base64'
,
'-e'
)
as
proc
:
out
,
err
=
proc
.
communicate
(
b
'a
\xff
b
\n
'
)
self
.
assertEqual
(
out
.
rstrip
(),
b
'Yf9iCg=='
)
self
.
assertIsNone
(
err
)
def
test_decode
(
self
):
with
open
(
support
.
TESTFN
,
'wb'
)
as
fp
:
...
...
@@ -657,10 +654,5 @@ class TestMain(unittest.TestCase):
output
=
self
.
get_output
(
'-d'
,
support
.
TESTFN
)
self
.
assertEqual
(
output
.
rstrip
(),
b
'a
\xff
b'
)
def
test_main
():
support
.
run_unittest
(
__name__
)
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
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