diff --git a/.vscode/settings.json b/.vscode/settings.json index b2b8866..7a230e1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "python.testing.pytestArgs": [ - "test" + "src" ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true diff --git a/src/module/__pycache__/__init__.cpython-38.pyc b/src/module/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000..49c2810 Binary files /dev/null and b/src/module/__pycache__/__init__.cpython-38.pyc differ diff --git a/src/module/__pycache__/ashcount.cpython-38.pyc b/src/module/__pycache__/ashcount.cpython-38.pyc new file mode 100644 index 0000000..58bfaf8 Binary files /dev/null and b/src/module/__pycache__/ashcount.cpython-38.pyc differ diff --git a/test/__pycache__/test_somthing.cpython-38-pytest-6.1.1.pyc b/test/__pycache__/test_somthing.cpython-38-pytest-6.1.1.pyc new file mode 100644 index 0000000..2a97694 Binary files /dev/null and b/test/__pycache__/test_somthing.cpython-38-pytest-6.1.1.pyc differ diff --git a/test/p_t.py b/test/p_t.py new file mode 100644 index 0000000..0228265 --- /dev/null +++ b/test/p_t.py @@ -0,0 +1,8 @@ +# For test. +""" +For test. +""" +print("For test.") + +for i in range(10): + print("For test") \ No newline at end of file diff --git a/test/t_t.txt b/test/t_t.txt new file mode 100644 index 0000000..0e11114 --- /dev/null +++ b/test/t_t.txt @@ -0,0 +1,4 @@ +Hello, I am Ashkan, a programmer. + + +This part is for testing. \ No newline at end of file diff --git a/test/test_ashcount.py b/test/test_ashcount.py new file mode 100644 index 0000000..dabcae7 --- /dev/null +++ b/test/test_ashcount.py @@ -0,0 +1,26 @@ +import os +import sys + +path = os.path.join(os.getcwd(), "src") + +sys.path.append(path) + +from module.ashcount import counter , py_counter + +# def tset_counter1(): +# assert counter.line_counter(path="./test/t_t.txt") == 4 + +# def tset_counter2(): +# assert counter.counting_main_lines(path="./test/t_t.txt") == 2 + +# def tset_counter3(): +# assert counter.word_count(path="./test/t_t.txt") == 11 + +def tset_counter4(): + assert py_counter.python_line_count(path="./test/p_t.py") == 8 + +def tset_counter5(): + assert py_counter.python_comment_count(path="./test/p_t.py") == 2 + +def tset_counter6(): + assert py_counter.pure_python_code(path="./test/p_t.py") == 3 diff --git a/test/test_somthing.py b/test/test_somthing.py deleted file mode 100644 index f599073..0000000 --- a/test/test_somthing.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -import sys - -path = os.path.join(os.getcwd(), "src") - -sys.path.append(path) - -from module.ashcount import counter , py_counter - -def tset_counter1(): - assert counter.line_counter(path="./src/t_t.txt") == 4 - -def tset_counter2(): - assert counter.counting_main_lines(path="./src/t_t.txt") == 2 - -def tset_counter3(): - assert counter.word_count(path="./src/t_t.txt") == 11 - -def tset_counter4(): - assert py_counter.python_line_count(path="./src/p_t.py") == 8 - -def tset_counter5(): - assert py_counter.python_comment_count(path="./src/p_t.py") == 2 - -def tset_counter6(): - assert py_counter.pure_python_code(path="./src/p_t.py") == 3