Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Oddant1 committed Jun 27, 2024
1 parent dabde45 commit b664ace
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions q2cli/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,54 @@
from q2cli.click.type import QIIME2Type


EXPECTED_CITATIONS = """% use `qiime tools citations` on a QIIME 2 result for complete list
@article{key0,
author = {Unger, Donald L},
journal = {Arthritis & Rheumatology},
number = {5},
pages = {949--950},
publisher = {Wiley Online Library},
title = {Does knuckle cracking lead to arthritis of the fingers?},
volume = {41},
year = {1998}
}
@article{key1,
author = {Berry, Michael Victor and Geim, Andre Konstantin},
journal = {European Journal of Physics},
number = {4},
pages = {307},
publisher = {IOP Publishing},
title = {Of flying frogs and levitrons},
volume = {18},
year = {1997}
}
@article{key2,
author = {Witcombe, Brian and Meyer, Dan},
journal = {BMJ},
number = {7582},
pages = {1285--1287},
publisher = {British Medical Journal Publishing Group},
title = {Sword swallowing and its side effects},
volume = {333},
year = {2006}
}
@article{key3,
author = {Reimers, Eigil and Eftestøl, Sindre},
journal = {Arctic, antarctic, and alpine research},
number = {4},
pages = {483--489},
publisher = {BioOne},
title = {Response behaviors of Svalbard reindeer towards humans and humans disguised as polar bears on Edgeøya},
volume = {44},
year = {2012}
}
""" # noqa: E501


class CliTests(unittest.TestCase):
def setUp(self):
get_dummy_plugin()
Expand Down Expand Up @@ -359,6 +407,14 @@ def test_run_deprecated_gets_warning_msg(self):

self.assertIn('deprecated', result.output)

def test_get_citations(self):
qiime_cli = RootCommand()
command = qiime_cli.get_command(ctx=None, name='dummy-plugin')
result = self.runner.invoke(command, ['split-ints', '--citations'])

self.assertEqual(result.exit_code, 0)
self.assertEqual(result.output, EXPECTED_CITATIONS)


class TestOptionalArtifactSupport(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit b664ace

Please sign in to comment.