예제 #1
0
 def test_delete_member_value_error_legajo(self):
     with self.assertRaises(ValueError):
         MemberService().delete_member(222)
예제 #2
0
 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)
예제 #3
0
 def test_delete_member(self):
     MemberService().delete_member(0)
     self.assertEqual(Repository.membersList.get(0), None)
예제 #4
0
 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__)
예제 #5
0
 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__)
예제 #6
0
 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)
예제 #7
0
 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
예제 #8
0
 def __init__(self):
     self.fileReader = FileReader()
     self.data = os.path.join(os.path.join(basedir, 'member'), 'data')
     self.service = MemberService()