def test_delete_member_value_error_legajo(self): with self.assertRaises(ValueError): MemberService().delete_member(222)
def test_update_member_value_error(self, legajo, name, surname, age, phone): member = Member(name, surname, age, phone) with self.assertRaises(ValueError): MemberService().update_member(legajo, member)
def test_delete_member(self): MemberService().delete_member(0) self.assertEqual(Repository.membersList.get(0), None)
def test_update_member(self, legajo, name, surname, age, phone): member = Member(name, surname, age, phone) MemberService().update_member(legajo, member) self.assertDictEqual(Repository.membersList[legajo], member.__dict__)
def test_add_member(self, name, surname, age, phone): member = Member(name, surname, age, phone) memberKey = MemberService().add_member(member) self.assertDictEqual(Repository.membersList[memberKey], member.__dict__)
def test_assign_book(self): book = Book('Cuentos varios de Charles Dickens', 'Charles Dickens', '') book_id = BookService().add_book(book) member = Member("Daniel", "Quinteros", 35, 2615956565) member_legajo = MemberService().add_member(member) BookService().assign_book(book_id, member_legajo)
def assign_book(self, book_id, legajo): self.book_id = BookService().add_book(book_id) self._legajo = MemberService().add_member(legajo) return book_id, legajo
def __init__(self): self.fileReader = FileReader() self.data = os.path.join(os.path.join(basedir, 'member'), 'data') self.service = MemberService()