Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7aa9fc56
Commit
7aa9fc56
authored
Apr 16, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use uuencoded test images.
parent
684480f4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1579 additions
and
9 deletions
+1579
-9
Lib/test/greyrgb.uue
Lib/test/greyrgb.uue
+1547
-0
Lib/test/greytest.rgb
Lib/test/greytest.rgb
+0
-0
Lib/test/test_imageop.py
Lib/test/test_imageop.py
+13
-5
Lib/test/test_imgfile.py
Lib/test/test_imgfile.py
+19
-4
No files found.
Lib/test/greyrgb.uue
0 → 100644
View file @
7aa9fc56
This diff is collapsed.
Click to expand it.
Lib/test/greytest.rgb
deleted
100644 → 0
View file @
684480f4
File deleted
Lib/test/test_imageop.py
View file @
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
View file @
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