~mapclient.devs/mapclient/stable

« back to all changes in this revision

Viewing changes to tests/test_exceptions.py

  • Committer: musculoskeletal
  • Date: 2014-06-25 05:38:05 UTC
  • mfrom: (1.6.35 testing)
  • Revision ID: musculoskeletal@bioeng1033-20140625053805-jkqhi5oq74vmlntl
Merging testing into stable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
'''
 
3
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
 
4
    Copyright (C) 2012  University of Auckland
 
5
    
 
6
This file is part of MAP Client. (http://launchpad.net/mapclient)
 
7
 
 
8
    MAP Client is free software: you can redistribute it and/or modify
 
9
    it under the terms of the GNU General Public License as published by
 
10
    the Free Software Foundation, either version 3 of the License, or
 
11
    (at your option) any later version.
 
12
 
 
13
    MAP Client is distributed in the hope that it will be useful,
 
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
    GNU General Public License for more details.
 
17
 
 
18
    You should have received a copy of the GNU General Public License
 
19
    along with MAP Client.  If not, see <http://www.gnu.org/licenses/>..
 
20
'''
 
21
 
 
22
import unittest
 
23
 
 
24
from mapclient.exceptions import ClientRuntimeError
 
25
 
 
26
 
 
27
class ExceptionTestCase(unittest.TestCase):
 
28
 
 
29
    def test_client_runtime_error(self):
 
30
        error = ClientRuntimeError('title', 'desc')
 
31
        self.assertEqual(error.title, 'title')
 
32
        self.assertEqual(error.description, 'desc')
 
33
 
 
34
 
 
35
def suite():
 
36
    tests = unittest.TestSuite()
 
37
    tests.addTests(unittest.TestLoader().loadTestsFromTestCase(ExceptionTestCase))
 
38
    return tests
 
39
 
 
40
if __name__ == '__main__':
 
41
    unittest.TextTestRunner().run(suite())
 
42