Skip to content

Commit

Permalink
fix: count test, now its counting the elements
Browse files Browse the repository at this point in the history
resolve #11
  • Loading branch information
mmsesay committed Jun 18, 2020
1 parent c02e436 commit 9d344ca
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/test_excel_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class TestCount(unittest.TestCase):
"""
def test_one(self):
expect = 1
result = ef.COUNT(7)
result = ef.COUNT((7, ))
self.assertEqual(expect, result)

def test_different_types(self):
Expand All @@ -195,11 +195,17 @@ def test_different_types(self):
result = ef.COUNT(data)
self.assertEqual(expect, result)

# def test_mixed_range(self):
# expect = 5
# range = ((2, 4.8), (1, 12))
# result = ef.count(range, 28)
# self.assertEqual(expect, result)
def test_mixed_range(self):
"""
Counts the number of cells that contain numbers in cells A2 through A7,
and the value 2 : e.g =COUNT(A2:A7,2)
"""
expect = 5
range = ((2, 4.8), (1, 12))
# unpack the nested tuple
data = [element for rang in range for element in rang]
result = ef.COUNT((*data, 28))
self.assertEqual(expect, result)

def test_count_error(self):
pass # TODO: #DIV/0 etc
Expand Down

0 comments on commit 9d344ca

Please sign in to comment.