def test_get_sid_string_name(self): """ Validate getting a pysid object from a SID string """ sid_obj = win_dacl.get_sid("Administrators") self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual(win_dacl.get_sid_string(sid_obj), "S-1-5-32-544")
def test_get_sid_string_none(self): """ Validate getting a pysid object from None (NULL SID) """ sid_obj = win_dacl.get_sid(None) self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual(win_dacl.get_sid_string(sid_obj), "S-1-0-0")
def test_get_sid_string_name(self): ''' Validate getting a pysid object from a SID string ''' sid_obj = win_dacl.get_sid('Administrators') self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual(win_dacl.get_sid_string(sid_obj), 'S-1-5-32-544')
def test_get_name_using_sid_object(self): """ Test get_name passing a SID Object. Should return the string name """ # SID Object sid_obj = win_dacl.get_sid("Administrators") self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual(win_dacl.get_name(sid_obj), "Administrators")
def test_get_sid_sid_string(self): ''' Validate getting a pysid object from a SID string ''' sid_obj = win_dacl.get_sid('S-1-5-32-544') self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual( win32security.LookupAccountSid(None, sid_obj)[0], 'Administrators')
def test_get_sid_string(self): """ Validate getting a pysid object from a name """ sid_obj = win_dacl.get_sid("Administrators") self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual( win32security.LookupAccountSid(None, sid_obj)[0], "Administrators")
def test_get_name(self): ''' Get the name ''' # Case self.assertEqual(win_dacl.get_name('adMiniStrAtorS'), 'Administrators') # SID String self.assertEqual(win_dacl.get_name('S-1-5-32-544'), 'Administrators') # SID Object sid_obj = win_dacl.get_sid('Administrators') self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual(win_dacl.get_name(sid_obj), 'Administrators')
def test_get_name(self): """ Get the name """ # Case self.assertEqual(win_dacl.get_name("adMiniStrAtorS"), "Administrators") # SID String self.assertEqual(win_dacl.get_name("S-1-5-32-544"), "Administrators") # SID Object sid_obj = win_dacl.get_sid("Administrators") self.assertTrue(isinstance(sid_obj, pywintypes.SIDType)) self.assertEqual(win_dacl.get_name(sid_obj), "Administrators")