source: anuga_core/source/anuga/utilities/test_system_tools.py @ 4955

Last change on this file since 4955 was 4955, checked in by steve, 16 years ago

Fixed problems with entries of integer arrays not being integers, but
arrays. So needed to coerce to int in a couple of places.

Also mkstemp was being imported from the wrong module in test_system_tools

File size: 1.1 KB
Line 
1#!/usr/bin/env python
2
3
4import unittest
5from Numeric import zeros, array, allclose
6
7from system_tools import *
8
9class Test_system_tools(unittest.TestCase):
10    def setUp(self):
11        pass
12
13    def tearDown(self):
14        pass
15
16    def test_user_name(self):
17        user = get_user_name()
18
19        # print user
20        assert isinstance(user, basestring), 'User name should be a string'
21
22    def test_host_name(self):
23        host = get_host_name()
24
25        # print host
26        assert isinstance(host, basestring), 'User name should be a string'       
27    def test_compute_checksum(self):
28        """test_compute_checksum(self):
29
30        Check that checksums on files are OK
31        """
32        # FIXME: Not Done Yet
33
34        from tempfile import mkstemp
35
36        # Generate a text file
37        fd, pathname = mkstemp('.tmp', '', '.', '')
38
39       
40       
41
42       
43#-------------------------------------------------------------
44if __name__ == "__main__":
45    suite = unittest.makeSuite(Test_system_tools, 'test')
46    runner = unittest.TextTestRunner()
47    runner.run(suite)
48
49
50
51
Note: See TracBrowser for help on using the repository browser.