def create_account(users_name, username, password): """ function to create new credentials for a new account """ new_account = User(users_name) new_account = Credentials(username, password) return new_account
def test_check_user(self): ''' Function to test whether the login in function check_user works as expected ''' self.new_user = User("mwalo254","mwalo254") self.new_user.save_user() user2 = User('nick','nick9214') user2.save_user() for user in User.user_list: if user.lockname == user2.lockname and user.password == user2.password: current_user = user.lockname return current_user self.assertEqual(current_user,Account.check_user(user2.password,user2.lockname))
def test_delete_user(self): self.new_user.save_new_user() test_user = User("Rovine", 2345) test_user.save_new_user() self.new_user.delete_user() self.assertEqual(len(User.User_List),1)
def test_multi_save(self): self.new_user.save_user() self.new_user = User('Kk', 'pk', '1432') self.assertEqual(len(User.user_info), 1) #test for credentials self.new_credentials.save_info() self.new_credentials = Credentials('23', 'kde') self.assertEqual(len(Credentials.user_details), 3)
def __init__(self, parent): QObject.__init__(self, parent) self._parent = parent self._user = User() self._control_mode = self.AUTOMATIC self._lng = self.DEFAULT_LNG self._default = 0 self._emer = False self._what = ''
def test_delete_user(self): ''' delete user's account ''' self.new_user.save_user() test_user=User("mwalo254","mwalo254") test_user.save_user() self.new_user.delete_user() self.assertEqual(len(User.user_list),1)
def create_user(myname, mypassword): ''' Function to create a new user's account ''' new_user = User(myname, mypassword) return new_user
def setupUserConfig(self, config_xml): """! Parser xml configuration file. @param config_xml: airbus_cobot_gui configuration path. @type config_xml: string. """ #Check path from configuration file if not os.path.isfile(config_xml): self._context.getLogger().critical('User config file "%s" not found !'%config_xml) #Open and parse xml file xconfig = ElementTree.parse(config_xml).getroot() app_mode = self.APP_MODE_RELEASE try: app_mode = xconfig.attrib['mode'].lower() except: pass lng = Context.DEFAULT_LNG try: lng = xconfig.find('translate').attrib['type'].lower() except: pass xwindow = xconfig.find('window') if xwindow is None: self._context.getLogger().critical('Cannot found "<window>" tag into config file !') return try: self.display_mode = xwindow.attrib['display-mode'].lower() except: self.display_mode = "" #Read node window for node in xwindow: if node.tag == 'default-size': try: width = int(node.find('width').text) height = int(node.find('height').text) self.resize(width, height) except: self.resize(1920, 1080) elif node.tag == 'header': self.installHeader(node) elif node.tag == 'launcher': self.installLauncher(node) else: self.getContext().getLogger().warn('Invalid tag "%s" into user configuration !'%node.tag) self.getContext().switchLanguage(lng) if app_mode == self.APP_MODE_DEBUG: self.getContext().switchUser(User('Airbus Group', Privilege.EXPERT)) else: # Load default user none -> open login dialog self.getContext().switchUser(User()) login = LoginDialog(self, False) QTimer.singleShot(1000, login.show)
def setUp(self): self.new_user = User("Wanjala", 12345)
def test_save_multiple_user(self): self.new_user.save_new_user() second_user = User("Rovine",2345) second_user.save_new_user() self.assertEqual(len(User.User_List),2)
def create_user(f_name, l_name, p_number): new_user = User(f_name, l_name, p_number) return new_user
def setUp(self): """ The setup method is used to run before each testcase. """ self.new_account = User("James") #create user object
def setUp(self): self.new_user = User('Raphael', 'Katana', '0720132613') #new user self.new_credentials = Credentials('1123', 'hjk') #new credentials
def setUp(self): ''' Set up method to run before each test cases. ''' self.new_user = User("mwalo","mwalo9214") # create contact object