acc2cae94337f862cf85f28120b6d0785df5962d
[utils.git] / src / budget_sync / test / mock_bug.py
1 from typing import Optional
2
3
4 class MockBug:
5 def __init__(self,
6 bug_id: int,
7 cf_budget_parent: Optional[int],
8 cf_budget: str,
9 cf_total_budget: str,
10 cf_nlnet_milestone: Optional[str],
11 cf_payees_list: str,
12 summary: str):
13 self.id = bug_id
14 if cf_budget_parent is not None:
15 self.cf_budget_parent = cf_budget_parent
16 self.cf_budget = cf_budget
17 self.cf_total_budget = cf_total_budget
18 if cf_nlnet_milestone is None:
19 cf_nlnet_milestone = "---"
20 self.cf_nlnet_milestone = cf_nlnet_milestone
21 self.cf_payees_list = cf_payees_list
22 self.summary = summary
23
24 def __repr__(self):
25 cf_budget_parent = getattr(self, "cf_budget_parent", None)
26 return (f"MockBug(bug_id={self.id!r}, "
27 f"cf_budget_parent={cf_budget_parent!r}, "
28 f"cf_budget={self.cf_budget!r}, "
29 f"cf_total_budget={self.cf_total_budget!r}, "
30 f"cf_nlnet_milestone={self.cf_nlnet_milestone!r}, "
31 f"cf_payees_list={self.cf_payees_list!r}, "
32 f"summary={self.summary!r})")