コード例 #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
ファイル: RepositoryInFiles.py プロジェクト: VladutZzZ/Labs
 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()