def test_Client(): client = Client("name", "cnp") client.setName("nname") assert client.getName() == "nname" assert client.getCnp() == "cnp" client.setCnp("0") assert client.getCnp() == "0" client.setId(0)
def addNewClient(self, name, cnp): """ Public method that overwrites the one in the ClientList Extra functionality: Appends the newly added Client to the file O(n) """ client = Client(name, cnp) self.__clientFile = open(self.__filename, "a") errorList = self.validator.validateClient(self.clientList, client) if errorList != []: return errorList self.clientList.append(client) self.__clientFile.write(client.getName() + "|" + client.getCnp() + "|" + "|" + "0" + "\n") self.__clientFile.close()