Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Software Testing) expand_more
Software Testing / Test Doubles & Dependencies

fake repository

Learn fake repository in Software Testing with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.

12 min read • Intermediate
software-testing-019.py
python
class FakeRepo:
    def __init__(self): self.rows={}
    def save(self,id,row): self.rows[id]=row
    def get(self,id): return self.rows[id]
r=FakeRepo(); r.save(1,{'name':'A'}); assert r.get(1)['name']=='A'
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content