[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests -
test_publication.py:1.1
Fred L. Drake, Jr.
fred at zope.com
Mon Jun 14 16:46:43 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv5372/zpkgtools/tests
Added Files:
test_publication.py
Log Message:
let zkpgtools set the Trove development status based on the indicator in the
version number
=== Added File Packages/zpkgtools/zpkgtools/tests/test_publication.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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 for zpkgtools.publication
$Id: test_publication.py,v 1.1 2004/06/14 20:46:41 fdrake Exp $
"""
import unittest
from zpkgtools import publication
class DevelopmentStatusTestCase(unittest.TestCase):
def test_set_development_status_replace_1(self):
metadata = publication.loads(
"Name: foo\n"
"Classifier: Development Status:: 3 - Alpha\n")
publication.set_development_status(metadata, publication.BETA)
self.assertEqual(metadata.classifiers, [publication.BETA])
def test_set_development_status_replace_2(self):
metadata = publication.loads(
"Name: foo\n"
"Classifier: Environment :: Console\n"
"Classifier: Development Status:: 3 - Alpha\n"
"Classifier: Intended Audience :: Developers\n")
publication.set_development_status(metadata, publication.BETA)
self.assertEqual(metadata.classifiers, [
"Environment :: Console",
publication.BETA,
"Intended Audience :: Developers",
])
def test_set_development_status_append(self):
metadata = publication.loads(
"Name: foo\n"
"Classifier: Environment :: Console\n"
"Classifier: Intended Audience :: Developers\n")
publication.set_development_status(metadata, publication.BETA)
self.assertEqual(metadata.classifiers, [
"Environment :: Console",
"Intended Audience :: Developers",
publication.BETA,
])
def test_suite():
return unittest.makeSuite(DevelopmentStatusTestCase)
More information about the Zope-CVS
mailing list