Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/constraintstests.py
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-10-02 22:24:56 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-10-02 22:24:56 (GMT)
commitcf40c1951f4f0f26090226fb4969ca147341a031 (patch)
treeb3bb17043645aff11a93940eba90d7488bcebf45 /tests/constraintstests.py
parent09b2ea3369df967309f030f9196c2f9861bc1b2c (diff)
LP 439980 : Refactored the XMLSerializer to support complex components; Corrected specs for the addons properties and constructor parameters names; Moved all existing actions and events to components (except a few left in code for testing purposes)
Diffstat (limited to 'tests/constraintstests.py')
-rw-r--r--tests/constraintstests.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/constraintstests.py b/tests/constraintstests.py
index b7b0a47..4e19a92 100644
--- a/tests/constraintstests.py
+++ b/tests/constraintstests.py
@@ -16,6 +16,9 @@
import unittest
+import uuid
+import os
+
from sugar.tutorius.constraints import *
class ConstraintTest(unittest.TestCase):
@@ -218,10 +221,18 @@ class EnumConstraintTest(unittest.TestCase):
assert False, "Wrong exception type thrown"
class FileConstraintTest(unittest.TestCase):
+ def setUp(self):
+ self.temp_filename = "sample_file_" + str(uuid.uuid1()) + ".txt"
+ self.file1 = file(self.temp_filename, "w")
+ self.file1.close()
+
+ def tearDown(self):
+ os.unlink(self.temp_filename)
+
def test_validate(self):
cons = FileConstraint()
- cons.validate("run-tests.py")
+ cons.validate(self.temp_filename)
try:
cons.validate("unknown/file.py")
@@ -230,4 +241,4 @@ class FileConstraintTest(unittest.TestCase):
pass
if __name__ == "__main__":
- unittest.main() \ No newline at end of file
+ unittest.main()