コード例 #1
0
	def test_basic_conversion(self):
		"""Test basic id2name.  May need to modify for different systems"""
		user_group.uid2uname_dict = {}; user_group.gid2gname_dict = {}
		assert user_group.uid2uname(0) == "root"
		assert user_group.uid2uname(0) == "root"
		assert user_group.gid2gname(0) == "root"
		assert user_group.gid2gname(0) == "root"
		# Assume no user has uid 29378
		assert user_group.gid2gname(29378) is None
		assert user_group.gid2gname(29378) is None
コード例 #2
0
 def test_basic_conversion(self):
     """Test basic id2name.  May need to modify for different systems"""
     user_group._uid2uname_dict = {}
     user_group._gid2gname_dict = {}
     assert user_group.uid2uname(0) == "root"
     assert user_group.uid2uname(0) == "root"
     assert user_group.gid2gname(0) == "root"
     assert user_group.gid2gname(0) == "root"
     # Assume no user has uid 29378
     assert user_group.gid2gname(29378) is None
     assert user_group.gid2gname(29378) is None
コード例 #3
0
 def test_basic_conversion(self):
     """Test basic id2name.  May need to modify for different systems"""
     user_group._uid2uname_dict = {}
     user_group._gid2gname_dict = {}
     self.assertEqual(user_group.uid2uname(0), "root")
     self.assertEqual(user_group.uid2uname(0), "root")
     self.assertEqual(user_group.gid2gname(0), "root")
     self.assertEqual(user_group.gid2gname(0), "root")
     # Assume no user has uid 29378
     self.assertIsNone(user_group.gid2gname(29378))
     self.assertIsNone(user_group.gid2gname(29378))
コード例 #4
0
	def test_overflow(self):
		"""Make sure querying large uids/gids doesn't raise exception"""
		large_num = 4000000000
		assert user_group.uid2uname(large_num) is None
		assert user_group.gid2gname(large_num) is None
コード例 #5
0
 def test_overflow(self):
     """Make sure querying large uids/gids doesn't raise exception"""
     large_num = 4000000000
     assert user_group.uid2uname(large_num) is None
     assert user_group.gid2gname(large_num) is None