Esempio n. 1
0
    def test_user_exists(self):
        '''
        Test to checks if a cluster admin or database user exists.
        '''
        with patch.object(influx08, 'user_list', side_effect=[[{'name': 'A'}],
                                                              None]):
            self.assertTrue(influx08.user_exists(name='A',
                                                 user='******',
                                                 password='******',
                                                 host='localhost',
                                                 port=8000))

            self.assertFalse(influx08.user_exists(name='A',
                                                  user='******',
                                                  password='******',
                                                  host='localhost',
                                                  port=8000))
Esempio n. 2
0
    def test_user_exists(self):
        '''
        Test to checks if a cluster admin or database user exists.
        '''
        with patch.object(influx08, 'user_list', side_effect=[[{'name': 'A'}],
                                                              None]):
            self.assertTrue(influx08.user_exists(name='A',
                                                 user='******',
                                                 password='******',
                                                 host='localhost',
                                                 port=8000))

            self.assertFalse(influx08.user_exists(name='A',
                                                  user='******',
                                                  password='******',
                                                  host='localhost',
                                                  port=8000))