working on implementing write_budget_markdown
[utils.git] / src / budget_sync / test / test_budget_graph.py
index 21786a18b744954e47c992a3617f6d16ca53bf29..a8857cb8793e8b80134740ffba121d90052354f0 100644 (file)
@@ -127,12 +127,15 @@ EXAMPLE_CHILD_BUG2 = MockBug(bug_id=2,
 
 EXAMPLE_CONFIG = Config.from_str(
     """
-    bugzilla_url = ""
+    bugzilla_url = "https://bugzilla.example.com/"
     [people."person1"]
     aliases = ["person1_alias1", "alias1"]
+    output_markdown_file = "person1.mdwn"
     [people."person2"]
     aliases = ["person1_alias2", "alias2", "person 2"]
+    output_markdown_file = "person2.mdwn"
     [people."person3"]
+    output_markdown_file = "person3.mdwn"
     [milestones]
     "milestone 1" = { canonical_bug_id = 1 }
     "milestone 2" = { canonical_bug_id = 2 }
@@ -176,6 +179,8 @@ class TestBudgetGraph(unittest.TestCase):
         self.assertIs(node.root, node)
         self.assertIsNone(node.parent_id)
         self.assertEqual(node.immediate_children, set())
+        self.assertEqual(node.bug_url,
+                         "https://bugzilla.example.com/show_bug.cgi?id=1")
         self.assertEqual(node.budget_excluding_subtasks, Money(cents=0))
         self.assertEqual(node.budget_including_subtasks, Money(cents=0))
         self.assertIsNone(node.milestone)
@@ -212,6 +217,8 @@ class TestBudgetGraph(unittest.TestCase):
         self.assertEqual(node1.budget_excluding_subtasks, Money(cents=1000))
         self.assertEqual(node1.budget_including_subtasks, Money(cents=2000))
         self.assertEqual(node1.milestone_str, "milestone 1")
+        self.assertEqual(node1.bug_url,
+                         "https://bugzilla.example.com/show_bug.cgi?id=1")
         self.assertEqual(list(node1.children()), [node2])
         self.assertEqual(list(node1.children_breadth_first()), [node2])
         self.assertEqual(node1.payments, {})
@@ -225,6 +232,8 @@ class TestBudgetGraph(unittest.TestCase):
         self.assertEqual(node2.budget_including_subtasks, Money(cents=1000))
         self.assertEqual(node2.milestone_str, "milestone 1")
         self.assertEqual(node2.payments, {})
+        self.assertEqual(node2.bug_url,
+                         "https://bugzilla.example.com/show_bug.cgi?id=2")
 
     def test_children(self):
         bg = BudgetGraph([