Skip to content

Commit

Permalink
Refactor directory service to include test_create_directory method an…
Browse files Browse the repository at this point in the history
…d update unit test
  • Loading branch information
xuwenyihust committed Jul 8, 2024
1 parent 77071d4 commit 81086c1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/tests/services/test_directory_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def test_get_content_by_path(self):
content = Directory.get_content_by_path()
self.assertEqual(content, [])

# def test_create_directory(self):
# with self.app.app_context():
# Directory.create_directory('666')
def test_create_directory(self):
with self.app.app_context():
Directory.create_directory('work/test_directory')
directoryFromDB = DirectoryModel.query.filter_by(path='work/test_directory').first()
self.assertIsNotNone(directoryFromDB)

response = Directory.get_content_by_path('work/test_directory')
print(response)

0 comments on commit 81086c1

Please sign in to comment.