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
7aa9fc56
Kaydet (Commit)
7aa9fc56
authored
Nis 16, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use uuencoded test images.
üst
684480f4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
9 deletions
+32
-9
greyrgb.uue
Lib/test/greyrgb.uue
+0
-0
greytest.rgb
Lib/test/greytest.rgb
+0
-0
test_imageop.py
Lib/test/test_imageop.py
+13
-5
test_imgfile.py
Lib/test/test_imgfile.py
+19
-4
No files found.
Lib/test/greyrgb.uue
0 → 100644
Dosyayı görüntüle @
7aa9fc56
This diff is collapsed.
Click to expand it.
Lib/test/greytest.rgb
deleted
100644 → 0
Dosyayı görüntüle @
684480f4
File deleted
Lib/test/test_imageop.py
Dosyayı görüntüle @
7aa9fc56
#! /usr/bin/env python
"""Test script for the imageop module. This has the side
effect of partially testing the imgfile module as well.
Roger E. Masse
"""
from
test_support
import
verbose
import
imageop
from
test_support
import
verbose
,
unlink
import
imageop
,
uu
def
main
(
use_rgbimg
=
1
):
# Create binary test files
uu
.
decode
(
get_qualified_path
(
'testrgb.uue'
),
'test.rgb'
)
if
use_rgbimg
:
image
,
width
,
height
=
getrgbimage
(
'test.rgb'
)
else
:
...
...
@@ -106,7 +111,10 @@ def main(use_rgbimg=1):
# Convert a 2-bit greyscale image to an 8-bit greyscale image.
if
verbose
:
print
'grey22grey'
image
=
imageop
.
grey22grey
(
grey2image
,
width
,
height
)
image
=
imageop
.
grey22grey
(
grey2image
,
width
,
height
)
# Cleanup
unlink
(
'test.rgb'
)
def
getrgbimage
(
name
):
"""return a tuple consisting of image (in 'imgfile' format but
...
...
@@ -160,6 +168,6 @@ def get_qualified_path(name):
name
=
string
.
joinfields
(
parts
,
os
.
sep
)
return
name
# rgbimg (unlike imgfile) is portable to platforms other than SGI. So we prefer to use it.
# rgbimg (unlike imgfile) is portable to platforms other than SGI.
# So we prefer to use it.
main
(
use_rgbimg
=
1
)
Lib/test/test_imgfile.py
Dosyayı görüntüle @
7aa9fc56
#! /usr/bin/env python
"""Simple test script for imgfile.c
Roger E. Masse
"""
from
test_support
import
verbose
import
imgfile
from
test_support
import
verbose
,
unlink
import
imgfile
,
uu
,
os
def
main
():
def
main
():
uu
.
decode
(
findfile
(
'testrgb.uue'
),
'test.rgb'
)
uu
.
decode
(
findfile
(
'greyrgb.uue'
),
'greytest.rgb'
)
# Test a 3 byte color image
testimage
(
'test.rgb'
)
...
...
@@ -15,6 +20,16 @@ def main():
# Test a 1 byte greyscale image
testimage
(
'greytest.rgb'
)
unlink
(
'test.rgb'
)
unlink
(
'greytest.rgb'
)
def
findfile
(
file
):
if
os
.
path
.
isabs
(
file
):
return
file
import
sys
for
dn
in
sys
.
path
:
fn
=
os
.
path
.
join
(
dn
,
file
)
if
os
.
path
.
exists
(
fn
):
return
fn
return
file
def
testimage
(
name
):
"""Run through the imgfile's battery of possible methods
...
...
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