Created
March 18, 2024 17:26
-
-
Save jangia/b5b80026828fbabb5647a16efde35343 to your computer and use it in GitHub Desktop.
Testing behavior, not implementation details – In-Memory Store Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# behavior/tests.py | |
def test_add_task_(): | |
store = TaskStoreInMemory() | |
task = Task(title="Do the dishes", status=TaskStatus.OPEN) | |
store.add_task(task) | |
assert store.tasks[0].title == "Do the dishes" | |
assert store.tasks[0].status == "OPEN" | |
def test_list_tasks_(): | |
store = TaskStoreInMemory() | |
task = Task(title="Do the dishes", status=TaskStatus.OPEN) | |
store.tasks.append(task) | |
assert store.list_tasks() == [task] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment