Skip to content

Commit

Permalink
update fileio lab
Browse files Browse the repository at this point in the history
  • Loading branch information
rambasnet committed Oct 30, 2023
1 parent d649597 commit cecf289
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 11 additions & 3 deletions labs/fileio/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,23 @@ def readData() -> List[int]:


def sortListInAscendingOrder(lstInts: List[int]):
"""Sort the provided list in ascending order.
Args:
lstInts (List[int]): the list to be sorted.
"""
# FIXME2
# sort lstInts list in ascending order
pass


def sortListInDescendingOrder(lstInts):
def sortListInDescendingOrder(lstInts: List[int]):
"""Sort the provided list in descending order.
Args:
lstInts (List[int]): the list to be sorted.
"""
# FIXME3
# sort lstInts in descending order
pass


def printList(printFile, lstInts: List[int]):
Expand Down
14 changes: 9 additions & 5 deletions labs/fileio/test_file_io.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import labs.fileio.file_io as file_io
"""Modue to test file_io.py
"""

import file_io

def test_sort_ascending():

def test_sort_ascending1():
my_nums = [10, 9, 0. - 6]
file_io.sortListInAscendingOrder(my_nums)
assert (my_nums == [-6, 0, 9, 10])

# add 3 more test cases
# add 3 more test cases in separate test functions


def test_sort_descending():
def test_sort_descending1():
my_nums = [0, -10, -1, 5, 100]
file_io.sortListInDescendingOrder(my_nums)
my_nums == [100, 5, 0, -1, -10]

# add 3 more test cases

# add 3 more test cases in seeparate test functions

0 comments on commit cecf289

Please sign in to comment.