Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README.md #43

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ In order to write Unit Tests, you have to put it inside `tests`.
There are many possibilities, for example it's possible to add a new user appending a `User` object in `possible_users`.
As generic Unit Tests it is possible to add a new test, appending it to `tests`.


### Unit Tests without mocking
To add a new unit test without mocking, there are some examples at the beginning of `tests`, but let's inspect how they're implemented:
- `func`: simply the function to mock
Expand All @@ -33,4 +34,4 @@ To add a new unit test without mocking, there are some examples at the beginning
If is necessary one or more mock(s), it's possible to append three more keys to the unit test. The test should have the same keys with three more keys:
- `mock_obj`: it's a list of the objects in which there are the functions to mock. In our examples they often refer to the main object (the one imported from src.main)
- `mock_func`: an array of strings, it indicates the functions to mock
- `mock_ret`: a list of the returned values
- `mock_ret`: a list of the returned values
1 change: 0 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
def get_new_user_name(user: User) -> str:
return f"@{user['username']}" if user['username'] is not None else user['first_name']


def generate_welcome(new_member: User) -> str:
new_member_username = get_new_user_name(new_member)

Expand Down
Loading