Skip to content

Commit

Permalink
new emotion: surprised
Browse files Browse the repository at this point in the history
  • Loading branch information
giovanni-guidini committed Oct 16, 2023
1 parent 3dc8379 commit 5412258
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions emotions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def crying(self):

def unamused(self):
raise NotImplementedError()

def surprised(self):
raise NotImplementedError()


from emotions.ascii import AsciiEmotions
Expand Down
3 changes: 3 additions & 0 deletions emotions/ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ def crying(self):

def unamused(self):
return '--"'

def surprised(self):
return ':O'
3 changes: 3 additions & 0 deletions emotions/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ def crying(self):

def unamused(self):
return "😒"

def surprised(self):
return "😮"
9 changes: 9 additions & 0 deletions emotions/tests/test_emotions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def test_frown(self):
def test_bored(self):
assert self.emotion_class.bored() == ":|"

def test_unamused(self):
assert self.emotion_class.unamused() == '--"'

def test_surprised(self):
assert self.emotion_class.surprised() == ":O"


class TestEmojiEmotions:
emotion_class = EmojiEmotions()
Expand All @@ -29,3 +35,6 @@ def test_bored(self):

def test_unamused(self):
assert self.emotion_class.unamused() == "😒"

def test_surprised(self):
assert self.emotion_class.surprised() == "😮"
12 changes: 8 additions & 4 deletions emotions/tests/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def test_init_emoji(self):
"1": "crying",
"2": "frown",
"3": "smile",
"4": "unamused",
"4": "surprised",
"5": "unamused",
}

def test_init_ascii(self):
Expand All @@ -29,7 +30,8 @@ def test_init_ascii(self):
"1": "crying",
"2": "frown",
"3": "smile",
"4": "unamused",
"4": "surprised",
"5": "unamused",
}

def test_menu_options(self):
Expand All @@ -39,7 +41,8 @@ def test_menu_options(self):
"1. crying",
"2. frown",
"3. smile",
"4. unamused",
"4. surprised",
"5. unamused",
]

@patch("builtins.input", side_effect=["0"])
Expand All @@ -56,7 +59,8 @@ def test_menu_choice_apple(self, mock_input):
"1. crying",
"2. frown",
"3. smile",
"4. unamused",
"4. surprised",
"5. unamused",
"",
"",
"😶",
Expand Down

0 comments on commit 5412258

Please sign in to comment.