Пример #1
0
    def test_lpThreadAttributes_input_handlingk(self):
        with mock_library(CreateProcess=self.NoOpCreateProcess):
            with self.assertRaises(InputError):
                CreateProcess(text_type(sys.executable),
                              lpApplicationName=None,
                              lpProcessAttributes=None,
                              lpThreadAttributes=1,
                              bInheritHandles=True,
                              dwCreationFlags=None,
                              lpEnvironment=None,
                              lpCurrentDirectory=None,
                              lpStartupInfo=None)

            CreateProcess(text_type(sys.executable),
                          lpApplicationName=None,
                          lpProcessAttributes=None,
                          lpThreadAttributes=SECURITY_ATTRIBUTES(),
                          bInheritHandles=True,
                          dwCreationFlags=None,
                          lpEnvironment=None,
                          lpCurrentDirectory=None,
                          lpStartupInfo=None)
Пример #2
0
 def test_missing_attr(self):
     sa = SECURITY_ATTRIBUTES()
     with self.assertRaises(AttributeError):
         sa.no_such_attr = None
Пример #3
0
 def test_attr_bInheritHandle_false(self):
     sa = SECURITY_ATTRIBUTES()
     sa.bInheritHandle = False
     self.assertEqual(sa.bInheritHandle, False)
Пример #4
0
 def test_attr_bInheritHandle_true(self):
     sa = SECURITY_ATTRIBUTES()
     sa.bInheritHandle = True
     self.assertEqual(sa.bInheritHandle, True)
Пример #5
0
 def test_attr_nLength_read_only(self):
     sa = SECURITY_ATTRIBUTES()
     with self.assertRaises(TypeError):
         sa.nLength = 1
Пример #6
0
 def test_missing_attr(self):
     sa = SECURITY_ATTRIBUTES()
     with self.assertRaises(AttributeError):
         sa.no_such_attr = None
Пример #7
0
 def test_attr_bInheritHandle_false(self):
     sa = SECURITY_ATTRIBUTES()
     sa.bInheritHandle = False
     self.assertEqual(sa.bInheritHandle, False)
Пример #8
0
 def test_attr_bInheritHandle_true(self):
     sa = SECURITY_ATTRIBUTES()
     sa.bInheritHandle = True
     self.assertEqual(sa.bInheritHandle, True)
Пример #9
0
 def test_attr_nLength_read_only(self):
     sa = SECURITY_ATTRIBUTES()
     with self.assertRaises(TypeError):
         sa.nLength = 1
Пример #10
0
 def test_attr_nLength(self):
     sa = SECURITY_ATTRIBUTES()
     self.assertGreater(sa.nLength, 0)