Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
 def test_threaded(self):
     try:
         check_cgroups.main([])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
Esempio n. 4
0
 def test_simple(self):
     try:
         check_cgroups.main(['--no-thread'])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
Esempio n. 5
0
 def test_threaded(self):
     try:
         check_cgroups.main([])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
Esempio n. 6
0
 def test_simple(self):
     try:
         check_cgroups.main(['--no-thread'])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)