def test_ClientList(): clientList = ClientList() clientList.addNewClient("name", "1910207205571") assert clientList.numberOfClients() == 1 assert clientList.lastAddedClient().getName() == "name" assert clientList.lastAddedClient().getCnp() == "1910207205571" clientList.addNewClient("New Name", "1910207205111") clientList.updateClient("name", "1910207205571", "a", "1111111111111") assert clientList.lastAddedClient().getName() == "New Name" assert clientList.lastAddedClient().getCnp() == "1910207205111" clientList.removeClient("New Name", "1910207205111") assert clientList.numberOfClients() == 1 assert clientList.lastAddedClient().getName() == "a" assert clientList.lastAddedClient().getCnp() == "1111111111111"
''' Created on Nov 1, 2012 @author: Mihai Costea ''' from blackBox import blackBoxTest_updateBook from controller.Controller import LibraryController from controller.tests import test_controller from repository.RepositoryInFiles import BookListInFile, ClientListInFile from repository.Storage import BookList, ClientList from ui.Console import Console if __name__ == '__main__': #bookList = BookList() #clientList = ClientList() bookList = BookListInFile("books.dat") clientList = ClientListInFile("clients.dat") testBookList = BookList() testClientList = ClientList() test_controller(testBookList, testClientList) blackBoxTest_updateBook() libraryController = LibraryController(bookList, clientList) console = Console(libraryController)