Skip to content

Commit

Permalink
add new feature for complex string op (666 response)
Browse files Browse the repository at this point in the history
  • Loading branch information
iperoyg committed Aug 23, 2022
1 parent ddaa91b commit 1d1105b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "complexoperations_iperoyg"
version = "0.1.3"
version = "0.1.4"
authors = [
{ name="Arthur Iperoyg", email="[email protected]" },
]
Expand Down
2 changes: 2 additions & 0 deletions src/complexoperations/JustSomeString.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def operate(self, text: str, n: int = 1) -> int:
return "Essa é a resposta para todas as perguntas"
if n == 13:
return "É galo"
if n == 666:
return "O.O"
replicated = text * n
cleaned = ''.join([e for i, e in enumerate(replicated) if i % n != 0])
return cleaned
14 changes: 14 additions & 0 deletions test/complexoperations/test_JustSomeString.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,17 @@ def test4(self):
assert result == 'Essa é a resposta para todas as perguntas'

pass

def test5(self):
# Arrange
complexop = JustSomeString()
number = 666
text = 'abcd'

# Act
result = complexop.operate(text, number)

# Assert
assert result == 'O.O'

pass

0 comments on commit 1d1105b

Please sign in to comment.