Esempio n. 1
0
    def testCheckTimeExpiredwithNoListUsers(self, m):
        """testadmintoken check that we have an admin token"""

        expiredusers = ExpiredUsers('any tenant id', 'any username', 'any password')

        # There was no users in the list
        expiredusers.listUsers = []
        expiredusers.token = 'a token'

        result = expiredusers.get_list_expired_users()

        expectedresult = []

        self.assertEqual(expectedresult, result)
Esempio n. 2
0
    def testCheckTimeExpired(self, m):
        """testadmintoken check that we have an admin token"""
        m.get(requests_mock.ANY, json=self.text_callback)

        expiredusers = ExpiredUsers('any tenant id', 'any username', 'any password')
        expiredusers.token = 'a token'
        expiredusers.listUsers = ['0f4de1ea94d342e696f3f61320c15253',
                                  '24396976a1b84eafa5347c3f9818a66a',
                                  'e3294fcf05984b3f934e189fa92c6990']

        result = expiredusers.get_list_expired_users()

        expectedresult = ['24396976a1b84eafa5347c3f9818a66a', 'e3294fcf05984b3f934e189fa92c6990']

        self.assertEqual(expectedresult, result)