コード例 #1
0
 def test_validate_invalid_count_thread(self):
     accepted = False
     thread = 10
     try:
         validate.thread(thread)
     except ValueError as e:
         accepted = True
     assert accepted
コード例 #2
0
 def test_validate_valid_thread(self):
     accepted = True
     thread = 1
     try:
         validate.thread(thread)
     except ValueError as e:
         accepted = False
     assert accepted
コード例 #3
0
 def test_validate_invalid_str_thread(self):
     accepted = False
     thread = 'foobar'
     try:
         validate.thread(thread)
     except ValueError as e:
         accepted = True
     assert accepted
コード例 #4
0
 def parse_threads(self):
     """determine threads"""
     if self.options['threads'] is None:
         return settings.threads()
     validate.thread(self.options["threads"])
     return self.options['threads']
コード例 #5
0
ファイル: utility.py プロジェクト: cloudpassage/connector
 def parse_threads(self):
     """determine threads"""
     if self.options['threads'] is None:
         return settings.threads()
     validate.thread(self.options["threads"])
     return self.options['threads']