Skip to content

Commit 314ce2c

Browse files
authored
Merge pull request #1 from mohammadpagard/feature/add-tests
improve -Made tests/ directory and move all tests files to this direc…
2 parents 6eea85b + b8c8459 commit 314ce2c

File tree

7 files changed

+11
-3
lines changed

7 files changed

+11
-3
lines changed
File renamed without changes.

tests/__init__.py

Whitespace-only changes.

limit/test.py renamed to tests/test_limit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .limit import limit_struct
1+
from ..limit import limit_struct
22

33

44
class TestLimit:

top-one/test.py renamed to tests/test_top_one.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .top_one import top_one
1+
from ..top_one import top_one
22

33

44
class TestTopOne:

tests/test_two_sum.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ..two_sum import two_sum_sorted
2+
3+
class TestTwoSum:
4+
def test_two_sum_sorted(self):
5+
assert two_sum_sorted([1, 3, 4, 5, 6, 6, 7], 13) == "6 + 7 = 13"
6+
assert two_sum_sorted([1, 3, 4, 5, 6, 6, 7], 18) == "So, you couldn't fund your target in this list..."
7+
assert two_sum_sorted([1, 2], 3) == "1 + 2 = 3"
8+
assert two_sum_sorted([], 3) == "So, you couldn't fund your target in this list..."
9+
assert two_sum_sorted([1, 3, 4, 5 , 6, 6, 7], 0) == "So, you couldn't fund your target in this list..."
File renamed without changes.

two_sum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ def two_sum_sorted(array: list[int], target: int) -> str:
1717
elif current < target:
1818
left += 1
1919
return "So, you couldn't fund your target in this list..."
20-

0 commit comments

Comments
 (0)