Exemple #1
0
 def test_update_success(self, data, repo: Repository, dao: IDao):
     id_ = dao.insert(**data)
     entity = repo.find(id_)
     entity.frame_type = 'road'
     repo.update(entity)
     assert dao.get(id_) == {'frame_type': 'road', 'wheel_type': 'road'}
Exemple #2
0
 def test_add(self, data, repo: Repository, dao: IDao):
     entity = Bike(**data)
     id_ = repo.add(entity)
     assert dao.get(id_) == data
Exemple #3
0
 def test_create_and_add(self, data, repo: Repository, dao: IDao):
     entity = repo.create_and_add(**data)
     assert dao.get(entity.id) == data
 def test_update_success(self, data, repo: Repository, dao: IDao):
     id_ = dao.insert(**data)
     entity = repo.find(id_)
     entity.frame_type = "road"
     repo.update(entity)
     assert dao.get(id_) == {"frame_type": "road", "wheel_type": "road"}