Skip to content

Commit

Permalink
feat: add get_files_in_directory test
Browse files Browse the repository at this point in the history
  • Loading branch information
aboutmydreams committed May 16, 2024
1 parent b3efee2 commit 803f9dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
[![Downloads](https://pepy.tech/badge/way3)](https://pepy.tech/project/way3)
[![Contributors](https://img.shields.io/github/contributors/aboutmydreams/way3.svg)](https://github.com/aboutmydreams/way3/graphs/contributors)



Way3 is a Python module for performing file operations such as creating, appending to, and deleting files. It provides a convenient and easy-to-use interface for performing file operations.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="way3",
version="0.0.20",
version="0.0.21",
author="aboutmydreams",
author_email="[email protected]",
description="Simplified file path management for Python developers",
Expand Down
11 changes: 9 additions & 2 deletions tests/test_file_find.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
from way3 import get_current_dir
from way3 import get_current_dir, get_files_in_directory

import unittest


class TestFileFind(unittest.TestCase):
def test_result(self):
result = get_current_dir(__file__)
print(result)
self.assertIn("way3/tests", result, "result fail: expected file")

def test_get_files_in_directory(self):
current_directory = "tests" # 当前目录
files = get_files_in_directory(current_directory)
self.assertIn(
"tests/test_file_find.py", files, "result fail: expected test_file_find.py"
)
self.assertEqual(len(files) > 1, True, "result fail: expected > 3")

0 comments on commit 803f9dc

Please sign in to comment.