Ejemplo 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
Ejemplo 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
Ejemplo n.º 3
0
 def test_threaded(self):
     try:
         check_cgroups.main([])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
Ejemplo 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)
Ejemplo n.º 5
0
 def test_threaded(self):
     try:
         check_cgroups.main([])
     except SystemExit as e:
         # expected if cgroups are not available
         self.skipTest(e)
Ejemplo 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)