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
1c4eb2c0
Kaydet (Commit)
1c4eb2c0
authored
Tem 17, 2012
tarafından
Hynek Schlawack
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Fix context manager use in posixpath.join() tests
The asserts were useless (and buggy).
üst
426e248f
7cdc2bdd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
test_posixpath.py
Lib/test/test_posixpath.py
+12
-9
No files found.
Lib/test/test_posixpath.py
Dosyayı görüntüle @
1c4eb2c0
...
...
@@ -56,15 +56,18 @@ class PosixPathTest(unittest.TestCase):
self
.
assertEqual
(
posixpath
.
join
(
b
"/foo/"
,
b
"bar/"
,
b
"baz/"
),
b
"/foo/bar/baz/"
)
with
self
.
assertRaises
(
TypeError
)
as
e
:
posixpath
.
join
(
b
'bytes'
,
'str'
)
self
.
assertIn
(
"Can't mix strings and bytes"
,
e
.
args
[
0
])
with
self
.
assertRaises
(
TypeError
)
as
e
:
posixpath
.
join
(
'str'
,
b
'bytes'
)
self
.
assertIn
(
"Can't mix strings and bytes"
,
e
.
args
[
0
])
with
self
.
assertRaises
(
TypeError
)
as
e
:
posixpath
.
join
(
'str'
,
bytearray
(
b
'bytes'
))
self
.
assertIn
(
"Can't mix strings and bytes"
,
e
.
args
[
0
])
# Check for friendly str/bytes mixing message
for
args
in
[[
b
'bytes'
,
'str'
],
[
bytearray
(
b
'bytes'
),
'str'
]]:
for
_
in
range
(
2
):
with
self
.
assertRaises
(
TypeError
)
as
cm
:
posixpath
.
join
(
*
args
)
self
.
assertEqual
(
"Can't mix strings and bytes in path components."
,
cm
.
exception
.
args
[
0
]
)
args
.
reverse
()
# check both orders
def
test_split
(
self
):
self
.
assertEqual
(
posixpath
.
split
(
"/foo/bar"
),
(
"/foo"
,
"bar"
))
...
...
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