From 3840c4e768ea536d86061c81c63d62d1d72ac3ef Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 16 Oct 2021 10:10:31 -0400 Subject: [PATCH] tests: Add test for UDA Orphan identification --- test/uda_orphan.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/uda_orphan.t b/test/uda_orphan.t index c7632d16c..99984ca35 100755 --- a/test/uda_orphan.t +++ b/test/uda_orphan.t @@ -82,6 +82,24 @@ class TestUDAOrphans(TestCase): code, out, err = self.t("_get 1.description") self.assertIn("one extra:foo", out) + def test_orphan_identification(self): + """Verify that orphans are identified by +ORPHAN tag and udas command""" + + # Create one task with legitimate orphan attribute and others without + self.t("rc.uda.extra.type:string rc.uda.extra.label:Extra add one extra:foo") + self.t("add two no attributes") + self.t("add three +test ") + self.t("add four +test depends:3") + self.t("4 annotate annotation content") + + # Only the first task should be identified as orphan + code, out, err = self.t("+ORPHAN ids") + self.assertEqual("1", out.strip()) + + # Only the first task should be identified as orphan + code, out, err = self.t("udas") + self.assertRegex(out, r'extra\s+1\s+1 Orphan UDA') + if __name__ == "__main__": from simpletap import TAPTestRunner