comparison test/test_status.py @ 59:9cb94b9ac6a6

merge
author Bernhard Herzog <bh@intevation.de>
date Tue, 10 Apr 2007 18:17:53 +0200
parents 39b2deea8481
children b19bf5895a55
comparison
equal deleted inserted replaced
56:83e1aa122ad0 59:9cb94b9ac6a6
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)