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
065f7b86
Kaydet (Commit)
065f7b86
authored
May 13, 2003
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed test_anydbm_creates to use proper paths for the created db.
Made some stylistic fixes.
üst
1213bdd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
test_bsddb185.py
Lib/test/test_bsddb185.py
+11
-5
No files found.
Lib/test/test_bsddb185.py
Dosyayı görüntüle @
065f7b86
"""Tests for the bsddb185 module.
The file 185test.db found in Lib/test/ is for testing purposes with this
testing suite.
"""
from
test.test_support
import
verbose
,
run_unittest
,
findfile
import
unittest
import
bsddb185
...
...
@@ -8,24 +13,25 @@ import os
import
tempfile
class
Bsddb185Tests
(
unittest
.
TestCase
):
def
test_open_existing_hash
(
self
):
"verify we can open a file known to be a hash v2 file"
# Verify we can open a file known to be a hash v2 file
db
=
bsddb185
.
hashopen
(
findfile
(
"185test.db"
))
self
.
assertEqual
(
db
[
"1"
],
"1"
)
db
.
close
()
def
test_whichdb
(
self
):
"verify that whichdb correctly sniffs the known hash v2 file"
# Verify that whichdb correctly sniffs the known hash v2 file
self
.
assertEqual
(
whichdb
.
whichdb
(
findfile
(
"185test.db"
)),
"bsddb185"
)
def
test_anydbm_create
(
self
):
"verify that anydbm.open does *not* create a bsddb185 file"
# Verify that anydbm.open does *not* create a bsddb185 file
tmpdir
=
tempfile
.
mkdtemp
()
try
:
try
:
dbfile
=
os
.
path
.
join
(
tmpdir
,
"foo.db"
)
anydbm
.
open
(
dbfile
,
"c"
)
.
close
()
ftype
=
whichdb
.
whichdb
(
findfile
(
"foo.db"
)
)
anydbm
.
open
(
os
.
path
.
splitext
(
dbfile
)[
0
]
,
"c"
)
.
close
()
ftype
=
whichdb
.
whichdb
(
dbfile
)
self
.
assertNotEqual
(
ftype
,
"bsddb185"
)
finally
:
os
.
unlink
(
dbfile
)
...
...
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