From b664acea55851d9d6465ea9fcaa2573b231f72d6 Mon Sep 17 00:00:00 2001 From: Oddant1 Date: Thu, 27 Jun 2024 12:20:04 -0700 Subject: [PATCH] Test --- q2cli/tests/test_cli.py | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/q2cli/tests/test_cli.py b/q2cli/tests/test_cli.py index 76a3c6d9..8383f8d9 100644 --- a/q2cli/tests/test_cli.py +++ b/q2cli/tests/test_cli.py @@ -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() @@ -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):