Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
88ac137a
Commit
88ac137a
authored
Feb 13, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests of the App.version_txt.getZopeVersion() function.
parent
a8e05463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
lib/python/App/tests/__init__.py
lib/python/App/tests/__init__.py
+1
-0
lib/python/App/tests/test_version_txt.py
lib/python/App/tests/test_version_txt.py
+65
-0
No files found.
lib/python/App/tests/__init__.py
0 → 100644
View file @
88ac137a
# Needed to make this a Python package.
lib/python/App/tests/test_version_txt.py
0 → 100644
View file @
88ac137a
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Tests of the version number extraction."""
import
os
import
unittest
import
App.config
import
App.version_txt
class
VersionTextTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
cfg
=
App
.
config
.
getConfiguration
()
self
.
old_swhome
=
self
.
cfg
.
softwarehome
self
.
cfg
.
softwarehome
=
os
.
path
.
dirname
(
__file__
)
self
.
fn
=
os
.
path
.
join
(
self
.
cfg
.
softwarehome
,
"version.txt"
)
App
.
version_txt
.
_test_reset
()
def
tearDown
(
self
):
try
:
os
.
unlink
(
self
.
fn
)
except
OSError
:
pass
self
.
cfg
.
softwarehome
=
self
.
old_swhome
App
.
config
.
setConfiguration
(
self
.
cfg
)
def
writeVersion
(
self
,
s
):
f
=
open
(
self
.
fn
,
'w'
)
f
.
write
(
s
)
f
.
close
()
def
test_without_version_txt
(
self
):
self
.
assertEqual
(
App
.
version_txt
.
getZopeVersion
(),
(
-
1
,
-
1
,
-
1
,
''
,
-
1
))
def
test_with_version_txt_final
(
self
):
self
.
writeVersion
(
"Zope 2.6.1 (source release, python 2.1, linux2)"
)
self
.
assertEqual
(
App
.
version_txt
.
getZopeVersion
(),
(
2
,
6
,
1
,
''
,
-
1
))
def
test_with_version_txt_beta
(
self
):
self
.
writeVersion
(
"Zope 2.6.1b2 (source release, python 2.1, linux2)"
)
self
.
assertEqual
(
App
.
version_txt
.
getZopeVersion
(),
(
2
,
6
,
1
,
'b'
,
2
))
def
test_suite
():
return
unittest
.
makeSuite
(
VersionTextTestCase
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
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