source: main/waeup.sirp/branches/ulif-extimgstore/src/waeup/sirp/hostels/tests.py @ 7033

Last change on this file since 7033 was 6951, checked in by Henrik Bettermann, 13 years ago

Start implementation of hostels package.

  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
2## This program is free software; you can redistribute it and/or modify
3## it under the terms of the GNU General Public License as published by
4## the Free Software Foundation; either version 2 of the License, or
5## (at your option) any later version.
6##
7## This program is distributed in the hope that it will be useful,
8## but WITHOUT ANY WARRANTY; without even the implied warranty of
9## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10## GNU General Public License for more details.
11##
12## You should have received a copy of the GNU General Public License
13## along with this program; if not, write to the Free Software
14## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15##
16"""
17Tests for hostels.
18"""
19from zope.interface.verify import verifyClass, verifyObject
20from waeup.sirp.hostels.interfaces import (
21    IHostelsContainer, IHostel)
22from waeup.sirp.hostels.container import HostelsContainer
23from waeup.sirp.hostels.hostel import Hostel
24from waeup.sirp.testing import (FunctionalLayer, FunctionalTestCase)
25
26class HostelsContainerTestCase(FunctionalTestCase):
27
28    layer = FunctionalLayer
29
30    def test_interfaces(self):
31        # Make sure the correct interfaces are implemented.
32        self.assertTrue(
33            verifyClass(
34                IHostelsContainer, HostelsContainer)
35            )
36        self.assertTrue(
37            verifyObject(
38                IHostelsContainer, HostelsContainer())
39            )
40        self.assertTrue(
41            verifyClass(
42                IHostel, Hostel)
43            )
44        self.assertTrue(
45            verifyObject(
46                IHostel, Hostel())
47            )
48        return
49
50    def test_base(self):
51        # We cannot call the fundamental methods of a base in that case
52        container = HostelsContainer()
53        self.assertRaises(
54            NotImplementedError, container.archive)
55        self.assertRaises(
56            NotImplementedError, container.clear)
Note: See TracBrowser for help on using the repository browser.