コード例 #1
0
ファイル: test_cgroups.py プロジェクト: FArian/tbf
    def test_thread_result_is_returned(self):
        """
        Test that an error raised by check_cgroup_availability is correctly
        re-raised in the main thread by replacing this function temporarily.
        """
        tmp = check_cgroups.check_cgroup_availability
        try:
            check_cgroups.check_cgroup_availability = lambda wait: exit(1)

            with self.assertRaises(SystemExit):
                check_cgroups.main([])

        finally:
            check_cgroups.check_cgroup_availability = tmp
コード例 #2
0
ファイル: test_cgroups.py プロジェクト: FArian/tbf
    def test_thread_result_is_returned(self):
        """
        Test that an error raised by check_cgroup_availability is correctly
        re-raised in the main thread by replacing this function temporarily.
        """
        tmp = check_cgroups.check_cgroup_availability
        try:
            check_cgroups.check_cgroup_availability = lambda wait : exit(1)

            with self.assertRaises(SystemExit):
                check_cgroups.main([])

        finally:
            check_cgroups.check_cgroup_availability = tmp
コード例 #3
0
ファイル: test_cgroups.py プロジェクト: FArian/tbf
 def test_threaded(self):
     try:
         check_cgroups.main([])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
コード例 #4
0
ファイル: test_cgroups.py プロジェクト: FArian/tbf
 def test_simple(self):
     try:
         check_cgroups.main(['--no-thread'])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
コード例 #5
0
ファイル: test_cgroups.py プロジェクト: FArian/tbf
 def test_threaded(self):
     try:
         check_cgroups.main([])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
コード例 #6
0
ファイル: test_cgroups.py プロジェクト: FArian/tbf
 def test_simple(self):
     try:
         check_cgroups.main(['--no-thread'])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)