-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from nalbion/feature/get_email-from-gitconfig
get email from ~/.gitconfig
- Loading branch information
Showing
22 changed files
with
113 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import os | ||
MAX_GPT_MODEL_TOKENS = int(os.getenv('MAX_TOKENS')) | ||
MAX_GPT_MODEL_TOKENS = int(os.getenv('MAX_TOKENS', 8192)) | ||
MIN_TOKENS_FOR_GPT_RESPONSE = 600 | ||
MAX_QUESTIONS = 5 | ||
END_RESPONSE = "EVERYTHING_CLEAR" |
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
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
|
||
class Development(ProgressStep): | ||
class Meta: | ||
db_table = 'development' | ||
table_name = 'development' |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
class EnvironmentSetup(ProgressStep): | ||
class Meta: | ||
db_table = 'environment_setup' | ||
table_name = 'environment_setup' |
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
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
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
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
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,40 @@ | ||
import pytest | ||
from unittest.mock import patch, mock_open | ||
import uuid | ||
from .arguments import get_email, username_to_uuid | ||
|
||
|
||
def test_email_found_in_gitconfig(): | ||
mock_file_content = """ | ||
[user] | ||
name = test_user | ||
email = [email protected] | ||
""" | ||
with patch('os.path.exists', return_value=True): | ||
with patch('builtins.open', mock_open(read_data=mock_file_content)): | ||
assert get_email() == "[email protected]" | ||
|
||
|
||
def test_email_not_found_in_gitconfig(): | ||
mock_file_content = """ | ||
[user] | ||
name = test_user | ||
""" | ||
mock_uuid = "12345678-1234-5678-1234-567812345678" | ||
|
||
with patch('os.path.exists', return_value=True): | ||
with patch('builtins.open', mock_open(read_data=mock_file_content)): | ||
with patch.object(uuid, "uuid4", return_value=mock_uuid): | ||
assert get_email() == mock_uuid | ||
|
||
|
||
def test_gitconfig_not_present(): | ||
mock_uuid = "12345678-1234-5678-1234-567812345678" | ||
|
||
with patch('os.path.exists', return_value=False): | ||
with patch.object(uuid, "uuid4", return_value=mock_uuid): | ||
assert get_email() == mock_uuid | ||
|
||
|
||
def test_username_to_uuid(): | ||
assert username_to_uuid("test_user") == "31676025-316f-b555-e0bf-a12f0bcfd0ea" |