From 611cf69c9987b160f992eb17b938a2c810f2fd22 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 28 Oct 2015 14:12:12 -0400 Subject: [PATCH] Test: Added test for orphans listed in 'udas' output --- test/uda.t | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/uda.t b/test/uda.t index 520e3009e..2614530ba 100755 --- a/test/uda.t +++ b/test/uda.t @@ -65,6 +65,26 @@ class TestUdaCommand(TestBaseUda): self.assertIn("extra", out) +class TestUdaCommandOrphans(TestCase): + def setUp(self): + self.t = Task() + + def test_uda_command_orphans(self): + """The 'udas' command should list 'orphans'""" + # Create a task with a UDA. + self.t.config("uda.orphan.label", "orphan") + self.t.config("uda.orphan.type", "string") + self.t("add one orphan:Annie") + + # Convert the UDA to an orphan. + self.t.del_config("uda.orphan.label") + self.t.del_config("uda.orphan.type") + + code, out, err = self.t("udas") + self.assertIn("1 UDA defined", out) + self.assertIn("1 Orphan UDA", out) + + class TestUdaDate(TestBaseUda): def setUp(self): super(TestUdaDate, self).setUp()