-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mkdir): add mkdir bash command and fix github get user
- Loading branch information
Showing
7 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python3 | ||
# @Miou-zora Project, Mirror-Generator, 2023 | ||
|
||
import subprocess | ||
|
||
|
||
class BashUtils: | ||
@staticmethod | ||
def mkdir(path: str): | ||
if subprocess.run(["mkdir", path]).returncode == 1: | ||
raise Exception("Folder already exist: " + path) |
This file contains 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
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
# @Miou-zora Project, Mirror-Generator, 2023 | ||
|
||
import unittest | ||
from src.Utils.BashUtils import BashUtils | ||
import os | ||
|
||
|
||
class TestBashUtils(unittest.TestCase): | ||
def __init__(self, methodName: str = "runTest") -> None: | ||
super().__init__(methodName) | ||
|
||
def test_mkdir(self): | ||
folder_name = "test_folder" | ||
if os.path.exists(folder_name): | ||
self.fail("Folder already exist: " + folder_name) | ||
BashUtils.mkdir(folder_name) | ||
if not os.path.exists(folder_name): | ||
self.fail("Folder not created: " + folder_name) | ||
os.rmdir(folder_name) |
Empty file.