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
bea3947f
Kaydet (Commit)
bea3947f
authored
May 29, 2001
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Variety of test cases for call to builtin functions
üst
4c9dace3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
0 deletions
+126
-0
test_call
Lib/test/output/test_call
+1
-0
test_call.py
Lib/test/test_call.py
+125
-0
No files found.
Lib/test/output/test_call
0 → 100644
Dosyayı görüntüle @
bea3947f
test_call
Lib/test/test_call.py
0 → 100644
Dosyayı görüntüle @
bea3947f
import
unittest
from
test_support
import
run_unittest
# The test cases here cover several paths through the function calling
# code. They depend on the METH_XXX flag that is used to define a C
# function, which can't be verified from Python. If the METH_XXX decl
# for a C function changes, these tests may not cover the right paths.
class
CFunctionCalls
(
unittest
.
TestCase
):
def
test_varargs0
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
has_key
)
def
test_varargs1
(
self
):
{}
.
has_key
(
0
)
def
test_varargs2
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
has_key
,
0
,
1
)
def
test_varargs0_ext
(
self
):
try
:
{}
.
has_key
(
*
())
except
TypeError
:
pass
def
test_varargs1_ext
(
self
):
{}
.
has_key
(
*
(
0
,))
def
test_varargs2_ext
(
self
):
try
:
{}
.
has_key
(
*
(
1
,
2
))
except
TypeError
:
pass
else
:
raise
RuntimeError
def
test_varargs0_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
has_key
,
x
=
2
)
def
test_varargs1_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
has_key
,
x
=
2
)
def
test_varargs2_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
has_key
,
x
=
2
,
y
=
2
)
def
test_oldargs0_0
(
self
):
{}
.
keys
()
def
test_oldargs0_1
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
keys
,
0
)
def
test_oldargs0_2
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
keys
,
0
,
1
)
def
test_oldargs0_0_ext
(
self
):
{}
.
keys
(
*
())
def
test_oldargs0_1_ext
(
self
):
try
:
{}
.
keys
(
*
(
0
,))
except
TypeError
:
pass
else
:
raise
RuntimeError
def
test_oldargs0_2_ext
(
self
):
try
:
{}
.
keys
(
*
(
1
,
2
))
except
TypeError
:
pass
else
:
raise
RuntimeError
def
test_oldargs0_0_kw
(
self
):
try
:
{}
.
keys
(
x
=
2
)
except
TypeError
:
pass
else
:
raise
RuntimeError
def
test_oldargs0_1_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
keys
,
x
=
2
)
def
test_oldargs0_2_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
keys
,
x
=
2
,
y
=
2
)
def
test_oldargs1_0
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
update
)
def
test_oldargs1_1
(
self
):
{}
.
update
({})
def
test_oldargs1_2
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
update
,
{},
1
)
def
test_oldargs1_0_ext
(
self
):
try
:
{}
.
update
(
*
())
except
TypeError
:
pass
else
:
raise
RuntimeError
def
test_oldargs1_1_ext
(
self
):
{}
.
update
(
*
({},))
def
test_oldargs1_2_ext
(
self
):
try
:
{}
.
update
(
*
({},
2
))
except
TypeError
:
pass
else
:
raise
RuntimeError
def
test_oldargs1_0_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
update
,
x
=
2
)
def
test_oldargs1_1_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
update
,
{},
x
=
2
)
def
test_oldargs1_2_kw
(
self
):
self
.
assertRaises
(
TypeError
,
{}
.
update
,
x
=
2
,
y
=
2
)
run_unittest
(
CFunctionCalls
)
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