# -*- coding: UTF-8 -*- """The eGovMon time package test $Id$ """ # Copyright 2008-2010 eGovMon # This program is distributed under the terms of the GNU General # Public License. # # This file is part of the eGovernment Monitoring # (eGovMon) # # eGovMon is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # eGovMon is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with eGovMon; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301 USA __author__ = "$Author: goodwin $" __version__ = "$Revision: 803 $" __updated__ = "$LastChangedDate$" import sc sc = sc.SystemConfiguration() import os import doctest, unittest from logit import * """Test suite for the RDF generator""" #Doctests result = [] class TestSequenceFunctions(unittest.TestCase): def testcanlog(self): log = open(os.path.join(sc.loglocation,'dummy.log'),'w') log.write('') log.close() self.assert_(not open(os.path.join(sc.loglocation,'dummy.log'),'r').read().strip()) logit('sometext','dummy') self.assert_('sometext' in open(os.path.join(sc.loglocation,'dummy.log'),'r').read().strip()) def testcanloglists(self): log = open(os.path.join(sc.loglocation,'dummy.log'),'w') log.write('') log.close() self.assert_(not open(os.path.join(sc.loglocation,'dummy.log'),'r').read().strip()) logit(['sometext','othertext','thirdtext'],'dummy') self.assert_('sometext' in open(os.path.join(sc.loglocation,'dummy.log'),'r').read().strip()) def testcanloglargertexts(self): log = open(os.path.join(sc.loglocation,'dummy.log'),'w') log.write('') log.close() self.assert_(not open(os.path.join(sc.loglocation,'dummy.log'),'r').read().strip()) logit('sometext\nothertext\nthirdtext','dummy') self.assert_('sometext' in open(os.path.join(sc.loglocation,'dummy.log'),'r').read().strip()) if __name__ == "__main__": result += unittest.main()