Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
comments and logging changed
Browse files Browse the repository at this point in the history
  • Loading branch information
kmpm committed Dec 12, 2019
1 parent 061977b commit af18197
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/torture.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
log = logging.getLogger(__name__)
logging.basicConfig(
filename='test.log',
level=logging.DEBUG,
level=logging.INFO,
format='%(asctime)s %(levelname)s %(module)s.%(funcName)s %(message)s')

LOOPPORT = 'loop://'
Expand All @@ -30,26 +30,26 @@ class TestTorture(unittest.TestCase):
uploader = None

def setUp(self):
log.debug("setUp")
log.info("setUp")
self.uploader = Uploader(SERIALPORT)

def tearDown(self):
log.debug("tearDown")
log.info("tearDown")
if is_real():
self.uploader.node_restart()
self.uploader.close()
time.sleep(1)

def task_upload_verify_compile(self):
"""Upload lua code, verify and compile"""
log.debug('upload-verify-compile')
log.info('upload-verify-compile')
self.assertTrue(self.uploader.prepare())
dests = operation_upload(self.uploader, "tests/fixtures/*.lua", 'sha1', True, False, False)
return len(dests)

def task_upload_verify(self):
"""Upload some text files and verify"""
log.debug('upload-verify')
log.info('upload-verify')
dests = operation_upload(self.uploader, "tests/fixtures/*_file.txt", 'sha1', False, False, False)
return len(dests)

Expand All @@ -62,12 +62,12 @@ def task_check_remote_files(self, wanted):

def task_remove_all_files(self):
"""Remove all files on device"""
log.debug('remove all files')
log.info('remove all files')
self.uploader.file_remove_all()

def task_download_all_files(self, files):
"""Downloads all files on device and do a sha1 checksum"""
log.debug('download all files and verify. %s', files)
log.info('download all files and verify. %s', files)
dest = os.path.join('.', 'tmp')
operation_download(self.uploader, files, dest=dest)
for f in files:
Expand All @@ -82,7 +82,8 @@ def task_remove_tmp(self):
shutil.rmtree(dest)

def test_for_long_time(self):
testcount = 2
"""Run a sequence of steps a number of times"""
testcount = 10
for x in range(testcount):
print('test sequence {0}/{1}'.format(x+1, testcount))
log.info('--- test sequence {0}/{1} ---'.format(x+1, testcount))
Expand Down

0 comments on commit af18197

Please sign in to comment.