Mercurial > treepkg
comparison test/test_status.py @ 187:b19bf5895a55
Use the FileTestMixin for the status tests, too.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Thu, 26 Jun 2008 16:38:09 +0000 |
parents | 39b2deea8481 |
children | b3f9cc956acc |
comparison
equal
deleted
inserted
replaced
186:2622bf5ed5bd | 187:b19bf5895a55 |
---|---|
1 # Copyright (C) 2007 by Intevation GmbH | 1 # Copyright (C) 2007, 2008 by Intevation GmbH |
2 # Authors: | 2 # Authors: |
3 # Bernhard Herzog <bh@intevation.de> | 3 # Bernhard Herzog <bh@intevation.de> |
4 # | 4 # |
5 # This program is free software under the GPL (>=v2) | 5 # This program is free software under the GPL (>=v2) |
6 # Read the file COPYING coming with the software for details. | 6 # Read the file COPYING coming with the software for details. |
13 from datetime import datetime | 13 from datetime import datetime |
14 | 14 |
15 from treepkg.status import RevisionStatus, Status, EnumFieldDesc | 15 from treepkg.status import RevisionStatus, Status, EnumFieldDesc |
16 from treepkg.util import ensure_directory, writefile | 16 from treepkg.util import ensure_directory, writefile |
17 | 17 |
18 from filesupport import FileTestMixin | |
18 | 19 |
19 | 20 |
20 class TestStatus(unittest.TestCase): | |
21 | 21 |
22 def tempfilename(self): | 22 class TestStatus(unittest.TestCase, FileTestMixin): |
23 tempdir = os.path.join(os.path.dirname(__file__), "temp") | |
24 ensure_directory(tempdir) | |
25 return os.path.join(tempdir, self.id()) | |
26 | 23 |
27 def setUp(self): | 24 def setUp(self): |
28 self.filename = self.tempfilename() | 25 self.filename = self.temp_file_name("status") |
29 if os.path.exists(self.filename): | 26 if os.path.exists(self.filename): |
30 os.remove(self.filename) | 27 os.remove(self.filename) |
31 | 28 |
32 def test_status(self): | 29 def test_status(self): |
33 status = RevisionStatus(self.filename) | 30 status = RevisionStatus(self.filename) |