Created
November 23, 2022 07:27
-
-
Save mhassanist/2bf44ddd6b7db74a1932ccc5b755b73b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from main import * | |
class TestCountFileLines(unittest.TestCase): | |
def test_file_line_count(self): | |
self.assertEqual(line_count(filename='README.md', lookup_value=''), 77) | |
def test_file_line_count_with_optional_argument(self): | |
self.assertEqual(line_count( | |
filename='README.md', lookup_value='Starter'), 1) | |
self.assertEqual(line_count( | |
filename='README.md', lookup_value='Team'), 0) | |
self.assertEqual(line_count( | |
filename='README.md', lookup_value='-1'), 0) | |
def test_file_line_count_wrong_file(self): | |
self.assertEqual(line_count( | |
filename='dummy.txt', lookup_value='Flow'), -1) | |
if __name__ == "__main__": | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment