st2client/tests/unit/test_auth.py
def runTest(self):
        '''Test 'st2 login' functionality by specifying a password and a configuration file
        '''

        expected_username = self.TOKEN['user']
        args = ['--config', self.CONFIG_FILE, 'login', expected_username, '--password',
                'Password1!']

        self.shell.run(args)

        with open(self.CONFIG_FILE, 'r') as config_file:
            for line in config_file.readlines():
                # Make sure certain values are not present
                self.assertFalse('password' in line)
                self.assertFalse('olduser' in line)

                # Make sure configured username is what we expect
                if 'username' in line:
                    self.assertEquals(line.split(' ')[2][:-1], expected_username)

            # validate token was created
            self.assertTrue(os.path.isfile('%stoken-%s' % (self.DOTST2_PATH, expected_username)))
Test 'st2 login' functionality by specifying a password and a configuration file
        
Test 'st2 login' functionality by specifying a password and a configuration file
Test ' st2 login ' functionality by specifying a password and a configuration file
def runTest(self):
        expected_username = self.TOKEN['user']
        args = ['--config', self.CONFIG_FILE, 'login', expected_username, '--password',
                'Password1!']
        self.shell.run(args)
        with open(self.CONFIG_FILE, 'r') as config_file:
            for line in config_file.readlines():
                self.assertFalse('password' in line)
                self.assertFalse('olduser' in line)
                if 'username' in line:
                    self.assertEquals(line.split(' ')[2][:-1], expected_username)
            self.assertTrue(os.path.isfile('%stoken-%s' % (self.DOTST2_PATH, expected_username)))
def runTest ( self ) : expected_username = self . TOKEN [ 'user' ] args = [ '--config' , self . CONFIG_FILE , 'login' , expected_username , '--password' , 'Password1!' ] self . shell . run ( args ) with open ( self . CONFIG_FILE , 'r' ) as config_file : for line in config_file . readlines ( ) : self . assertFalse ( 'password' in line ) self . assertFalse ( 'olduser' in line ) if 'username' in line : self . assertEquals ( line . split ( ' ' ) [ 2 ] [ : - 1 ] , expected_username ) self . assertTrue ( os . path . isfile ( '%stoken-%s' % ( self . DOTST2_PATH , expected_username ) ) )
Test 'st2 login' functionality by specifying a password and a configuration file
Test ' st2 login ' functionality by specifying a password and a configuration file
'''Test 'st2 login' functionality by specifying a password and a configuration file
        ''' # Make sure certain values are not present # Make sure configured username is what we expect # validate token was created
self