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
e3467d5c
Kaydet (Commit)
e3467d5c
authored
Şub 20, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove e assertIs definitions and use correct assert* methods.
üst
4cc80ca9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
45 deletions
+28
-45
test_bool.py
Lib/test/test_bool.py
+0
-6
test_complex.py
Lib/test/test_complex.py
+0
-3
test_genericpath.py
Lib/test/test_genericpath.py
+2
-5
test_macpath.py
Lib/test/test_macpath.py
+20
-20
test_posixpath.py
Lib/test/test_posixpath.py
+6
-8
test_richcmp.py
Lib/test/test_richcmp.py
+0
-3
No files found.
Lib/test/test_bool.py
Dosyayı görüntüle @
e3467d5c
...
...
@@ -7,12 +7,6 @@ import os
class
BoolTest
(
unittest
.
TestCase
):
def
assertIs
(
self
,
a
,
b
):
self
.
assertTrue
(
a
is
b
)
def
assertIsNot
(
self
,
a
,
b
):
self
.
assertTrue
(
a
is
not
b
)
def
test_subclass
(
self
):
try
:
class
C
(
bool
):
...
...
Lib/test/test_complex.py
Dosyayı görüntüle @
e3467d5c
...
...
@@ -72,9 +72,6 @@ class ComplexTest(unittest.TestCase):
self
.
assertCloseAbs
(
x
.
real
,
y
.
real
,
eps
)
self
.
assertCloseAbs
(
x
.
imag
,
y
.
imag
,
eps
)
def
assertIs
(
self
,
a
,
b
):
self
.
assertTrue
(
a
is
b
)
def
check_div
(
self
,
x
,
y
):
"""Compute complex z=x*y, and check that z/x==y and z/y==x."""
z
=
x
*
y
...
...
Lib/test/test_genericpath.py
Dosyayı görüntüle @
e3467d5c
...
...
@@ -5,9 +5,6 @@ import genericpath
class
AllCommonTest
(
unittest
.
TestCase
):
def
assertIs
(
self
,
a
,
b
):
self
.
assertTrue
(
a
is
b
)
def
test_commonprefix
(
self
):
self
.
assertEqual
(
genericpath
.
commonprefix
([]),
...
...
@@ -50,8 +47,8 @@ class AllCommonTest(unittest.TestCase):
f
.
close
()
self
.
assertEqual
(
d
,
"foobar"
)
self
.
assert
True
(
genericpath
.
getctime
(
test_support
.
TESTFN
)
<=
self
.
assert
LessEqual
(
genericpath
.
getctime
(
test_support
.
TESTFN
)
,
genericpath
.
getmtime
(
test_support
.
TESTFN
)
)
finally
:
...
...
Lib/test/test_macpath.py
Dosyayı görüntüle @
e3467d5c
...
...
@@ -6,7 +6,7 @@ import unittest
class
MacPathTestCase
(
unittest
.
TestCase
):
def
test_abspath
(
self
):
self
.
assert
True
(
macpath
.
abspath
(
"xx:yy"
)
==
"xx:yy"
)
self
.
assert
Equal
(
macpath
.
abspath
(
"xx:yy"
),
"xx:yy"
)
# Issue 3426: check that abspath retuns unicode when the arg is unicode
# and str when it's str, with both ASCII and non-ASCII cwds
...
...
@@ -31,38 +31,38 @@ class MacPathTestCase(unittest.TestCase):
def
test_commonprefix
(
self
):
commonprefix
=
macpath
.
commonprefix
self
.
assert
True
(
commonprefix
([
"home:swenson:spam"
,
"home:swen:spam"
])
==
"home:swen"
)
self
.
assert
True
(
commonprefix
([
":home:swen:spam"
,
":home:swen:eggs"
])
==
":home:swen:"
)
self
.
assert
True
(
commonprefix
([
":home:swen:spam"
,
":home:swen:spam"
])
==
":home:swen:spam"
)
self
.
assert
Equal
(
commonprefix
([
"home:swenson:spam"
,
"home:swen:spam"
]),
"home:swen"
)
self
.
assert
Equal
(
commonprefix
([
":home:swen:spam"
,
":home:swen:eggs"
]),
":home:swen:"
)
self
.
assert
Equal
(
commonprefix
([
":home:swen:spam"
,
":home:swen:spam"
]),
":home:swen:spam"
)
def
test_split
(
self
):
split
=
macpath
.
split
self
.
assertEqual
s
(
split
(
"foo:bar"
),
self
.
assertEqual
(
split
(
"foo:bar"
),
(
'foo:'
,
'bar'
))
self
.
assertEqual
s
(
split
(
"conky:mountpoint:foo:bar"
),
self
.
assertEqual
(
split
(
"conky:mountpoint:foo:bar"
),
(
'conky:mountpoint:foo'
,
'bar'
))
self
.
assertEqual
s
(
split
(
":"
),
(
''
,
''
))
self
.
assertEqual
s
(
split
(
":conky:mountpoint:"
),
self
.
assertEqual
(
split
(
":"
),
(
''
,
''
))
self
.
assertEqual
(
split
(
":conky:mountpoint:"
),
(
':conky:mountpoint'
,
''
))
def
test_splitdrive
(
self
):
splitdrive
=
macpath
.
splitdrive
self
.
assertEqual
s
(
splitdrive
(
"foo:bar"
),
(
''
,
'foo:bar'
))
self
.
assertEqual
s
(
splitdrive
(
":foo:bar"
),
(
''
,
':foo:bar'
))
self
.
assertEqual
(
splitdrive
(
"foo:bar"
),
(
''
,
'foo:bar'
))
self
.
assertEqual
(
splitdrive
(
":foo:bar"
),
(
''
,
':foo:bar'
))
def
test_splitext
(
self
):
splitext
=
macpath
.
splitext
self
.
assertEqual
s
(
splitext
(
":foo.ext"
),
(
':foo'
,
'.ext'
))
self
.
assertEqual
s
(
splitext
(
"foo:foo.ext"
),
(
'foo:foo'
,
'.ext'
))
self
.
assertEqual
s
(
splitext
(
".ext"
),
(
'.ext'
,
''
))
self
.
assertEqual
s
(
splitext
(
"foo.ext:foo"
),
(
'foo.ext:foo'
,
''
))
self
.
assertEqual
s
(
splitext
(
":foo.ext:"
),
(
':foo.ext:'
,
''
))
self
.
assertEqual
s
(
splitext
(
""
),
(
''
,
''
))
self
.
assertEqual
s
(
splitext
(
"foo.bar.ext"
),
(
'foo.bar'
,
'.ext'
))
self
.
assertEqual
(
splitext
(
":foo.ext"
),
(
':foo'
,
'.ext'
))
self
.
assertEqual
(
splitext
(
"foo:foo.ext"
),
(
'foo:foo'
,
'.ext'
))
self
.
assertEqual
(
splitext
(
".ext"
),
(
'.ext'
,
''
))
self
.
assertEqual
(
splitext
(
"foo.ext:foo"
),
(
'foo.ext:foo'
,
''
))
self
.
assertEqual
(
splitext
(
":foo.ext:"
),
(
':foo.ext:'
,
''
))
self
.
assertEqual
(
splitext
(
""
),
(
''
,
''
))
self
.
assertEqual
(
splitext
(
"foo.bar.ext"
),
(
'foo.bar'
,
'.ext'
))
def
test_main
():
...
...
Lib/test/test_posixpath.py
Dosyayı görüntüle @
e3467d5c
...
...
@@ -25,9 +25,6 @@ class PosixPathTest(unittest.TestCase):
test_support
.
unlink
(
test_support
.
TESTFN
+
suffix
)
safe_rmdir
(
test_support
.
TESTFN
+
suffix
)
def
assertIs
(
self
,
a
,
b
):
self
.
assertTrue
(
a
is
b
)
def
test_normcase
(
self
):
# Check that normcase() is idempotent
p
=
"FoO/./BaR"
...
...
@@ -158,8 +155,8 @@ class PosixPathTest(unittest.TestCase):
f
.
close
()
self
.
assertEqual
(
d
,
"foobar"
)
self
.
assert
True
(
posixpath
.
getctime
(
test_support
.
TESTFN
)
<=
self
.
assert
LessEqual
(
posixpath
.
getctime
(
test_support
.
TESTFN
)
,
posixpath
.
getmtime
(
test_support
.
TESTFN
)
)
finally
:
...
...
@@ -384,7 +381,7 @@ class PosixPathTest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
posixpath
.
normpath
)
def
test_abspath
(
self
):
self
.
assert
True
(
"foo"
in
posixpath
.
abspath
(
"foo"
))
self
.
assert
In
(
"foo"
,
posixpath
.
abspath
(
"foo"
))
# Issue 3426: check that abspath retuns unicode when the arg is unicode
# and str when it's str, with both ASCII and non-ASCII cwds
...
...
@@ -398,7 +395,7 @@ class PosixPathTest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
posixpath
.
abspath
)
def
test_realpath
(
self
):
self
.
assert
True
(
"foo"
in
realpath
(
"foo"
))
self
.
assert
In
(
"foo"
,
realpath
(
"foo"
))
self
.
assertRaises
(
TypeError
,
posixpath
.
realpath
)
if
hasattr
(
os
,
"symlink"
):
...
...
@@ -470,7 +467,8 @@ class PosixPathTest(unittest.TestCase):
self
.
assertEqual
(
realpath
(
ABSTFN
+
"/link-y/.."
),
ABSTFN
+
"/k"
)
# Relative path.
os
.
chdir
(
dirname
(
ABSTFN
))
self
.
assertEqual
(
realpath
(
basename
(
ABSTFN
)
+
"/link-y/.."
),
ABSTFN
+
"/k"
)
self
.
assertEqual
(
realpath
(
basename
(
ABSTFN
)
+
"/link-y/.."
),
ABSTFN
+
"/k"
)
finally
:
os
.
chdir
(
old_path
)
test_support
.
unlink
(
ABSTFN
+
"/link-y"
)
...
...
Lib/test/test_richcmp.py
Dosyayı görüntüle @
e3467d5c
...
...
@@ -281,9 +281,6 @@ class DictTest(unittest.TestCase):
class
ListTest
(
unittest
.
TestCase
):
def
assertIs
(
self
,
a
,
b
):
self
.
assertTrue
(
a
is
b
)
def
test_coverage
(
self
):
# exercise all comparisons for lists
x
=
[
42
]
...
...
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