all unit tests pass
[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 self.id = bug_id
12 if cf_budget_parent is not None:
13 self.cf_budget_parent = cf_budget_parent
14 self.cf_budget = cf_budget
15 self.cf_total_budget = cf_total_budget
16 if cf_nlnet_milestone is None:
17 cf_nlnet_milestone = "---"
18 self.cf_nlnet_milestone = cf_nlnet_milestone
19
20 def __repr__(self):
21 cf_budget_parent = getattr(self, "cf_budget_parent", None)
22 return (f"MockBug(bug_id={self.id!r}, "
23 f"cf_budget_parent={cf_budget_parent!r}, "
24 f"cf_budget={self.cf_budget!r}, "
25 f"cf_total_budget={self.cf_total_budget!r}, "
26 f"cf_nlnet_milestone={self.cf_nlnet_milestone!r})")