1
1
# testresources: extensions to python unittest to allow declaritive use
2
2
# of resources by test cases.
3
# Copyright (C) 2005-2008 Robert Collins <robertc@robertcollins.net>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
"""Example TestResource."""
22
from testresources import TestResource
25
class SampleTestResource(TestResource):
4
# Copyright (c) 2005-2010 Testresources Contributors
6
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
7
# license at the users choice. A copy of both licenses are available in the
8
# project source as Apache-2.0 and BSD. You may not use this file except in
9
# compliance with one of these two licences.
11
# Unless required by applicable law or agreed to in writing, software distributed
12
# under these licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
13
# CONDITIONS OF ANY KIND, either express or implied. See the license you chose
14
# for the specific language governing permissions and limitations under that
18
"""Example TestResourceManager."""
20
from testresources import TestResourceManager
23
class SampleTestResource(TestResourceManager):
35
33
"""My pet resource."""
38
class SampleWithDependencies(TestResource):
36
class SampleWithDependencies(TestResourceManager):
40
38
resources = [('foo', SampleTestResource()), ('bar', SampleTestResource())]