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
d9fbf353
Kaydet (Commit)
d9fbf353
authored
Ock 30, 2002
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
This test left a new set of 3 junk files behind each time it was run.
üst
c48a3ca1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
test_dumbdbm.py
Lib/test/test_dumbdbm.py
+18
-11
No files found.
Lib/test/test_dumbdbm.py
Dosyayı görüntüle @
d9fbf353
...
...
@@ -9,8 +9,16 @@ import unittest
import
dumbdbm
import
tempfile
_fname
=
tempfile
.
mktemp
()
def
_delete_files
():
for
ext
in
[
".dir"
,
".dat"
,
".bak"
]:
try
:
os
.
unlink
(
_fname
+
ext
)
except
OSError
:
pass
class
DumbDBMTestCase
(
unittest
.
TestCase
):
_fname
=
tempfile
.
mktemp
()
_dict
=
{
'0'
:
''
,
'a'
:
'Python:'
,
'b'
:
'Programming'
,
...
...
@@ -26,11 +34,8 @@ class DumbDBMTestCase(unittest.TestCase):
self
.
_dkeys
.
sort
()
def
test_dumbdbm_creation
(
self
):
for
ext
in
[
".dir"
,
".dat"
,
".bak"
]:
try
:
os
.
unlink
(
self
.
_fname
+
ext
)
except
OSError
:
pass
f
=
dumbdbm
.
open
(
self
.
_fname
,
'c'
)
_delete_files
()
f
=
dumbdbm
.
open
(
_fname
,
'c'
)
self
.
assertEqual
(
f
.
keys
(),
[])
for
key
in
self
.
_dict
:
f
[
key
]
=
self
.
_dict
[
key
]
...
...
@@ -38,18 +43,18 @@ class DumbDBMTestCase(unittest.TestCase):
f
.
close
()
def
test_dumbdbm_modification
(
self
):
f
=
dumbdbm
.
open
(
self
.
_fname
,
'w'
)
f
=
dumbdbm
.
open
(
_fname
,
'w'
)
self
.
_dict
[
'g'
]
=
f
[
'g'
]
=
"indented"
self
.
read_helper
(
f
)
f
.
close
()
def
test_dumbdbm_read
(
self
):
f
=
dumbdbm
.
open
(
self
.
_fname
,
'r'
)
f
=
dumbdbm
.
open
(
_fname
,
'r'
)
self
.
read_helper
(
f
)
f
.
close
()
def
test_dumbdbm_keys
(
self
):
f
=
dumbdbm
.
open
(
self
.
_fname
)
f
=
dumbdbm
.
open
(
_fname
)
keys
=
self
.
keys_helper
(
f
)
f
.
close
()
...
...
@@ -65,8 +70,10 @@ class DumbDBMTestCase(unittest.TestCase):
return
keys
def
test_main
():
test_support
.
run_unittest
(
DumbDBMTestCase
)
try
:
test_support
.
run_unittest
(
DumbDBMTestCase
)
finally
:
_delete_files
()
if
__name__
==
"__main__"
:
test_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