sfc_commandline.py
Go to the documentation of this file.00001
00002
00003 import unittest
00004 import os, sys, glob, shutil, commands
00005
00006 import SyFi
00007 import sfc
00008
00009 _test_temp_dir = "temp_dir"
00010 class SFCCommandlineTest(unittest.TestCase):
00011 def setUp(self):
00012 print "Running templatetest in testdir"
00013 print "Imported SyFi from location", SyFi.__file__
00014 print "Imported sfc from location", sfc.__file__
00015 shutil.rmtree(_test_temp_dir, ignore_errors=True)
00016 os.mkdir(_test_temp_dir)
00017 os.chdir(_test_temp_dir)
00018
00019 def tearDown(self):
00020 os.chdir("..")
00021
00022
00023 def testForms(self):
00024 forms = glob.glob("../forms/*.form")
00025 for f in forms:
00026
00027 cmd = "sfc %s" % f
00028 status, output = commands.getstatusoutput(cmd)
00029 self.assertTrue(status == 0)
00030
00031
00032
00033
00034
00035
00036 tests = [SFCCommandlineTest]
00037
00038 if __name__ == "__main__":
00039 unittest.main()