forked from canonical/lp-to-jira
-
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.
Merge pull request canonical#13 from canonical/lp-to-jira-tests
Added initial tests and argument parsing with argparse
- Loading branch information
Showing
7 changed files
with
312 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Ignore CPython artefacts | ||
__pycache__/ | ||
*.pyc | ||
|
||
# Ignore test artefacts | ||
.coverage | ||
.pytest_cache/ | ||
|
||
# Ignore pip artefacts | ||
*.egg-info/ |
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,38 @@ | ||
import pytest | ||
|
||
from unittest.mock import Mock | ||
|
||
@pytest.fixture | ||
def empty_bug(): | ||
bug = Mock() | ||
bug.title = "" | ||
bug.description = "" | ||
bug.id = 0 | ||
bug.tags = [] | ||
bug.web_link = "https://" | ||
bug.bug_tasks = [] | ||
|
||
return bug | ||
|
||
@pytest.fixture | ||
def lp(): | ||
bug = Mock() | ||
bug.title = "test bug" | ||
bug.id = 123456 | ||
bug.bug_tasks = [ | ||
Mock(bug_target_name=n, status=s) | ||
for n, s in zip(['systemd (Ubuntu)', | ||
'vim (Debian)', | ||
'glibc (Ubuntu)'], | ||
['New', | ||
'Confirmed', | ||
'New']) | ||
] | ||
|
||
project1 = Mock() | ||
project1.searchTasks = Mock(return_value=None) | ||
|
||
project2 = Mock() | ||
project2.searchTasks = Mock(return_value=bug) | ||
|
||
return Mock(bugs={123456: bug}, projects={"subiquity": project1, "curtin": project2}) |
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,45 @@ | ||
[metadata] | ||
name = LpToJira | ||
version = 0.6 | ||
description = A Command Line helper to import launchpad bug in JIRA. | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/canonical/lp-to-jira | ||
project_urls = | ||
Bug Reports = https://github.com/canonical/lp-to-jira/issues | ||
Source Code = https://github.com/mclemenceau/lp-to-jira | ||
classifiers = | ||
Development Status :: 3 - Alpha | ||
License :: OSI Approved :: GNU General Public License v2 (GPLv2) | ||
Operating System :: OS Independent | ||
Programming Language :: Python :: 3 | ||
|
||
[options] | ||
packages = find: | ||
install_requires = | ||
launchpadlib | ||
jira | ||
|
||
[options.extras_require] | ||
test = | ||
pytest | ||
pytest-cov | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
lp-to-jira = LpToJira.lp_to_jira:main | ||
lp-to-jira-report = LpToJira.lp_to_jira_report:main | ||
|
||
[tool:pytest] | ||
addopts = --cov | ||
testpaths = tests | ||
|
||
[coverage:run] | ||
source = LpToJira | ||
branch = true | ||
|
||
[coverage:report] | ||
show_missing = true | ||
exclude_lines = | ||
raise NotImplementedError | ||
assert False |
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,35 +1,3 @@ | ||
import setuptools | ||
|
||
from setuptools import setup | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setup( | ||
name="LpToJira", | ||
version="0.6", | ||
author="Matthieu Clemenceau", | ||
author_email="[email protected]", | ||
description=("A Command Line helper to import launchpad bug in JIRA."), | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/canonical/lp-to-jira", | ||
project_urls={ | ||
'Bug Reports': 'https://github.com/canonical/lp-to-jira/issues', | ||
'Source': 'https://github.com/canonical/lp-to-jira', | ||
}, | ||
packages=setuptools.find_packages(), | ||
keywords='lp to jira', | ||
entry_points={ | ||
'console_scripts': [ | ||
'lp-to-jira=LpToJira.lp_to_jira:main', | ||
'lp-to-jira-report=LpToJira.lp_to_jira_report:main', | ||
], | ||
}, | ||
install_requires=['jira','launchpadlib'], | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Operating System :: OS Independent", | ||
], | ||
) | ||
setup() |
Empty file.
Oops, something went wrong.