Пример #1
0
def cleanup(dest, tardir, counterfile):
    """Remove existing rules"""
    thefiles = Queue()
    # dest directory files
    queue_files(dest, thefiles)
    # tar directory files
    queue_files(tardir, thefiles)
    while not thefiles.empty():
        d_file = thefiles.get()
        info("Deleting file: %s" % d_file)
        os.unlink(d_file)
    if os.path.exists(counterfile):
        info("Deleting the counter file %s" % counterfile)
        os.unlink(counterfile)
Пример #2
0
def cleanup(dest, tardir, counterfile):
    """Remove existing rules"""
    thefiles = Queue()
    # dest directory files
    queue_files(dest, thefiles)
    # tar directory files
    queue_files(tardir, thefiles)
    while not thefiles.empty():
        d_file = thefiles.get()
        info("Deleting file: %s" % d_file)
        os.unlink(d_file)
    if os.path.exists(counterfile):
        info("Deleting the counter file %s" % counterfile)
        os.unlink(counterfile)
Пример #3
0
 def test_info(self, mock_print):
     msg = "This is a sample msg"
     info(msg)
     mock_print.assert_called_once_with(msg, file=sys.stdout)
Пример #4
0
 def test_info(self, mock_print):
     msg = "This is a sample msg"
     info(msg)
     mock_print.assert_called_once_with(msg, file=sys.stdout)