예제 #1
0
파일: tests.py 프로젝트: tudorgergely/Labs
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)
예제 #2
0
파일: tests.py 프로젝트: VladutZzZ/Labs
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)

    
예제 #3
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()
예제 #4
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()