コード例 #1
0
ファイル: strategy.py プロジェクト: occopus/infra-processor
 def _mk_process_name(self, instr):
     """
     Generate a process name based on the instruction
     """
     return 'Proc{0}-{1}'.format(
         instr.__class__.__name__,
         util.icoalesce(self._possible_process_names(instr)))
コード例 #2
0
 def _mk_process_name(self, instr):
     """
     Generate a process name based on the instruction
     """
     return 'Proc{0}-{1}'.format(
         instr.__class__.__name__,
         util.icoalesce(self._possible_process_names(instr))
     )
コード例 #3
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 def test_i_error(self):
     with self.assertRaises(DummyException):
         return util.icoalesce((None, None, None), DummyException(':P'))
コード例 #4
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 def test_i_third(self):
     self.assertEqual(util.icoalesce((None, None, 'third')), 'third')
コード例 #5
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 def test_i_first(self):
     self.assertEqual(util.icoalesce(('first', None, 'third')), 'first')
コード例 #6
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 def test_i_default(self):
     self.assertEqual(util.icoalesce([], 5), 5)
コード例 #7
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 def test_i_empty(self):
     self.assertIsNone(util.icoalesce([]))
コード例 #8
0
ファイル: general_tests.py プロジェクト: occopus/util
 def test_i_error(self):
     with self.assertRaises(DummyException):
         return util.icoalesce((None, None, None), DummyException(':P'))
コード例 #9
0
ファイル: general_tests.py プロジェクト: occopus/util
 def test_i_third(self):
     self.assertEqual(util.icoalesce((None, None, 'third')), 'third')
コード例 #10
0
ファイル: general_tests.py プロジェクト: occopus/util
 def test_i_first(self):
     self.assertEqual(util.icoalesce(('first', None, 'third')), 'first')
コード例 #11
0
ファイル: general_tests.py プロジェクト: occopus/util
 def test_i_default(self):
     self.assertEqual(util.icoalesce([], 5), 5)
コード例 #12
0
ファイル: general_tests.py プロジェクト: occopus/util
 def test_i_empty(self):
     self.assertIsNone(util.icoalesce([]))