Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify and refactor tests #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

simplify and refactor tests #6

wants to merge 1 commit into from

Conversation

lukaszmach
Copy link
Owner

No description provided.

@pytest.fixture
def mock_fake_credentials():
return {
'jira_base_url': 'https://your-mock-jira-server-url',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Być może jest sens użyć tego fixture również w test_load_settings_file_exists

}


def test_jira_authentication_success(mock_fake_user, mock_fake_credentials):

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Można ujednolicić formatowanie, aby po deklaracji funkcji była zawsze albo nie było wcale pustej linii

attachment1 = MockAttachment('?!?/?!', b'content1')
attachment2 = MockAttachment('file2.txt', b'content2')
return MockIssue(attachments=[attachment1, attachment2])


def test_download_attachments_validate_files_and_contents_goodfiles(tmpdir, mock_jira_issue_good_files):
def test_download_attachments_validate_files_and_contents_goodfiles(tmpdir, mock_jira_issue_valid_files):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid_files na końcu nazwy funkcji

with open(attachment_path, 'rb') as file:
assert file.read() == attachment.content


def test_download_attachments_validate_files_and_contents_bad_files(tmpdir, mock_jira_issue_bad_files):
def test_download_attachments_validate_files_and_contents_bad_files(tmpdir, mock_jira_issue_invalid_files):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid_files na końcu nazwy funkcji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants