Beispiel #1
0
    def test_init(self):
        """
        OSAvatar is impersonated.
        """
        avatar = mk.makeFilesystemOSAvatar()

        self.assertTrue(avatar.use_impersonation)
        self.assertProvides(IFileSystemAvatar, avatar)
Beispiel #2
0
 def setUpClass(cls):
     super(TestElevatedLocalTestFilesystem, cls).setUpClass()
     cls.user = compat_mk.getTestUser('normal')
     home_folder_path = system_users.getHomeFolder(
         username=cls.user.name, token=cls.user.token)
     cls.avatar = compat_mk.makeFilesystemOSAvatar(
         name=cls.user.name,
         home_folder_path=home_folder_path,
         token=cls.user.token,
         )
Beispiel #3
0
    def test_getPrimaryGroup_good(self):
        """
        Check getting primary group.
        """
        test_user = mk.getTestUser(u'normal')
        avatar = mk.makeFilesystemOSAvatar(
            name=TEST_ACCOUNT_USERNAME, token=test_user.token)

        group_name = system_users.getPrimaryGroup(username=avatar.name)
        if os.name == 'nt':
            self.assertEqual(WINDOWS_PRIMARY_GROUP, group_name)
        else:
            self.assertEqual(TEST_ACCOUNT_GROUP, group_name)