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)
def test_missing_attr(self): sa = SECURITY_ATTRIBUTES() with self.assertRaises(AttributeError): sa.no_such_attr = None
def test_attr_bInheritHandle_false(self): sa = SECURITY_ATTRIBUTES() sa.bInheritHandle = False self.assertEqual(sa.bInheritHandle, False)
def test_attr_bInheritHandle_true(self): sa = SECURITY_ATTRIBUTES() sa.bInheritHandle = True self.assertEqual(sa.bInheritHandle, True)
def test_attr_nLength_read_only(self): sa = SECURITY_ATTRIBUTES() with self.assertRaises(TypeError): sa.nLength = 1
def test_attr_nLength(self): sa = SECURITY_ATTRIBUTES() self.assertGreater(sa.nLength, 0)