-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add empty init files for Python modules
- Loading branch information
Lorena Mesa
committed
Jul 17, 2024
1 parent
0254d88
commit 029d0b7
Showing
6 changed files
with
16 additions
and
14 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
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 |
---|---|---|
|
@@ -124,8 +124,3 @@ def len_gt_zero(input_str: str): | |
|
||
identicon = Identicon(input_str=args.string) | ||
identicon.draw_image(filename=args.output) | ||
|
||
# hash_str =convert_string_to_sha_hash("931D387731bBbC988B31220") | ||
# hash_str = convert_string_to_sha_hash("[email protected]") | ||
# grid = build_grid(hash_str) | ||
# draw_image(grid, hash_str) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
ruffruff check --fix | ||
ruff |
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 |
---|---|---|
@@ -1,25 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pathlib import Path | ||
from PIL import Image | ||
import subprocess | ||
import unittest | ||
|
||
from main import Identicon | ||
|
||
__author__ = "Lorena Mesa" | ||
__email__ = "[email protected]" | ||
|
||
PROJECT_ROOT = Path(__file__).parent.parent.absolute() | ||
|
||
|
||
class TestHappyPath(unittest.TestCase): | ||
def test_fails_to_create_identicon_with_input_text_missing(self): | ||
class TestUI(unittest.TestCase): | ||
def test_ui_fails_to_create_identicon_with_input_text_missing(self): | ||
with self.assertRaises(subprocess.CalledProcessError) as context: | ||
subprocess.check_output(f'python3 {PROJECT_ROOT}/main.py', shell=True, stderr=subprocess.STDOUT).strip() | ||
subprocess.check_output(f"python3 {PROJECT_ROOT}/main.py", shell=True, stderr=subprocess.STDOUT).strip() | ||
self.assertIn(context.exception.message, "main.py: error: the following arguments are required: -s/--string") | ||
|
||
def test_creates_identicon_when_input_text_provided(self): | ||
pass | ||
|
||
|
||
class TestHappyPath(unittest.TestCase): | ||
def test_successfully_creates_identicon(self): | ||
identicon = Identicon("931D387731bBbC988B31220") | ||
identicon.draw_image(filename="output") | ||
image = Image.open(f"{PROJECT_ROOT}/output.png", mode="r") | ||
self.assertIsInstance(image, Image, "Image created is not of type PIL.Image") | ||
|
||
# hash_str =convert_string_to_sha_hash("931D387731bBbC988B31220") | ||
# hash_str = convert_string_to_sha_hash("[email protected]") | ||
# grid = build_grid(hash_str) | ||
|