Rev 39: Create a simple setup.py and rework tests modules accordingly. in http://bazaar.launchpad.net/%7Ebzr-upload-devs/bzr-upload/trunk
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed May 21 11:22:45 BST 2008
At http://bazaar.launchpad.net/%7Ebzr-upload-devs/bzr-upload/trunk
------------------------------------------------------------
revno: 39
revision-id: v.ladeuil+lp at free.fr-20080521102236-oqvd1artomogv89f
parent: argentina at gmail.com-20080521052344-rwejeoe99roupo6f
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: upload
timestamp: Wed 2008-05-21 12:22:36 +0200
message:
Create a simple setup.py and rework tests modules accordingly.
* tests/test_upload.py:
Renamed from test_upload.py.
* tests/__init__.py:
New file.
* setup.py:
New file.
* __init__.py:
(load_tests): Simplified.
added:
setup.py setup.py-20080521093825-mi13wnc5ko8xoawv-1
tests/ tests-20080521093647-gmxrrji3o19uvhu3-1
tests/__init__.py __init__.py-20080521093647-gmxrrji3o19uvhu3-2
renamed:
test_upload.py => tests/test_upload.py test_upload.py-20080307145942-xx1xgifrreovahgz-2
modified:
__init__.py __init__.py-20080307145942-xx1xgifrreovahgz-1
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py 2008-05-20 07:36:44 +0000
+++ b/__init__.py 2008-05-21 10:22:36 +0000
@@ -314,17 +314,13 @@
def load_tests(basic_tests, module, loader):
- result = loader.suiteClass()
- # add the tests for this module
-
# This module shouldn't define any tests but I don't know how to report
- # that. I prefer to keep the add Tests to detect unwanted tests and I think
- # that's sufficient.
- result.addTests(basic_tests)
+ # that. I prefer to update basic_tests with the other tests to detect
+ # unwanted tests and I think that's sufficient.
testmod_names = [
- 'test_upload',
+ 'tests',
]
- result.addTest(loader.loadTestsFromModuleNames(
+ basic_tests.addTest(loader.loadTestsFromModuleNames(
["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
- return result
+ return basic_tests
=== added file 'setup.py'
--- a/setup.py 1970-01-01 00:00:00 +0000
+++ b/setup.py 2008-05-21 10:22:36 +0000
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# Copyright (C) 2008 by Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from distutils.core import setup
+
+setup(name='bzr-upload',
+ description='Incrementally uploads changes to a dumb server',
+ keywords='plugin bzr upload dumb protocol',
+ version='0.0.1',
+ url='http://launchpad.net/bzr-upload',
+ download_url='http://launchpad.net/bzr-upload',
+ license='GPL',
+ long_description="""
+ Web sites are often hosted on servers where bzr can't be installed. In
+ other cases, the web site must not give access to its corresponding
+ branch (for security reasons for example). Finally, web hosting providers
+ often provides only ftp access to upload sites. This plugin uploads only
+ the relevant changes since the last upload using ftp or sftp protocols.
+ """,
+ package_dir={'bzrlib.plugins.upload':'.',
+ 'bzrlib.plugins.upload.tests':'tests'},
+ packages=['bzrlib.plugins.upload',
+ 'bzrlib.plugins.upload.tests']
+ )
=== added directory 'tests'
=== added file 'tests/__init__.py'
--- a/tests/__init__.py 1970-01-01 00:00:00 +0000
+++ b/tests/__init__.py 2008-05-21 10:22:36 +0000
@@ -0,0 +1,27 @@
+# Copyright (C) 2008 by Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+def load_tests(basic_tests, module, loader):
+ # This module shouldn't define any tests but I don't know how to report
+ # that. I prefer to update basic_tests with the other tests to detect
+ # unwanted tests and I think that's sufficient.
+
+ testmod_names = [
+ 'test_upload',
+ ]
+ basic_tests.addTest(loader.loadTestsFromModuleNames(
+ ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
+ return basic_tests
=== renamed file 'test_upload.py' => 'tests/test_upload.py'
More information about the bazaar-commits
mailing list