comparison test/test_status.py @ 58:39b2deea8481

make the status files are world readable
author Bernhard Herzog <bh@intevation.de>
date Tue, 10 Apr 2007 17:42:46 +0200
parents 3c5ab7a65384
children b19bf5895a55
comparison
equal deleted inserted replaced
57:d0d08c7e7d37 58:39b2deea8481
6 # Read the file COPYING coming with the software for details. 6 # Read the file COPYING coming with the software for details.
7 7
8 """Tests for the Status classes""" 8 """Tests for the Status classes"""
9 9
10 import os 10 import os
11 import stat
11 import unittest 12 import unittest
12 from datetime import datetime 13 from datetime import datetime
13 14
14 from treepkg.status import RevisionStatus, Status, EnumFieldDesc 15 from treepkg.status import RevisionStatus, Status, EnumFieldDesc
15 from treepkg.util import ensure_directory, writefile 16 from treepkg.util import ensure_directory, writefile
32 status = RevisionStatus(self.filename) 33 status = RevisionStatus(self.filename)
33 status.error() 34 status.error()
34 35
35 otherstatus = RevisionStatus(self.filename) 36 otherstatus = RevisionStatus(self.filename)
36 self.assertEquals(otherstatus.status.name, "error") 37 self.assertEquals(otherstatus.status.name, "error")
38
39 def test_status_file_permissions(self):
40 status = RevisionStatus(self.filename)
41 status.error()
42
43 mode = os.stat(self.filename).st_mode
44 self.assertEquals(stat.S_IMODE(mode) & 0444, 0444)
37 45
38 def test_getting_unknown_fields(self): 46 def test_getting_unknown_fields(self):
39 status = RevisionStatus(self.filename) 47 status = RevisionStatus(self.filename)
40 self.assertRaises(AttributeError, getattr, status, "unknown_field") 48 self.assertRaises(AttributeError, getattr, status, "unknown_field")
41 49
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)