<s> """<STR_LIT>""" <EOL> import unittest <EOL> import os <EOL> import shutil <EOL> from time import strftime <EOL> from RESTool . RESTool_main import Chrome , Firefox <EOL> class TestRES ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . chrome_sourcefile = "<STR_LIT>" <EOL> self . firefox_sourcefile = "<STR_LIT>" <EOL> self . chrome = Chrome ( ) <EOL> self . firefox = Firefox ( ) <EOL> self . chrome . path = self . chrome_sourcefile <EOL> self . firefox . path = self . firefox_sourcefile <EOL> def test_chrome_backup ( self ) : <EOL> backup_name = "<STR_LIT>" . format ( strftime ( "<STR_LIT>" ) ) <EOL> backup_path = os . path . join ( "<STR_LIT>" , backup_name ) <EOL> self . assertTrue ( self . chrome . backup ( ) ) <EOL> self . assertTrue ( os . path . exists ( backup_path ) ) <EOL> self . assertEqual ( open ( self . chrome_sourcefile ) . read ( ) , open ( backup_path ) . read ( ) ) <EOL> self . chrome . path = None <EOL> self . assertFalse ( self . chrome . backup ( ) ) <EOL> self . chrome . path = "<STR_LIT>" <EOL> self . assertFalse ( self . chrome . backup ( ) ) <EOL> def test_ff_backup ( self ) : <EOL> backup_name = "<STR_LIT>" . format ( strftime ( "<STR_LIT>" ) ) <EOL> backup_path = os . path . join ( "<STR_LIT>" , backup_name ) <EOL> self . assertTrue ( self . firefox . backup ( ) ) <EOL> self . assertTrue ( os . path . exists ( backup_path ) ) <EOL> self . assertEqual ( open ( self . firefox_sourcefile ) . read ( ) , open ( backup_path ) . read ( ) ) <EOL> self . firefox . path = None <EOL> self . assertFalse ( self . firefox . backup ( ) ) <EOL> self . firefox . path = "<STR_LIT>" <EOL> self . assertFalse ( self . firefox . backup ( ) ) <EOL> def test_chrome_to_ff ( self ) : <EOL> pass <EOL> def test_ff_to_chrome ( self ) : <EOL> pass <EOL> def tearDown ( self ) : <EOL> shutil . rmtree ( '<STR_LIT>' , ignore_errors = True ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
