def setUp(self): self.__wiki = FakeWiki() self.__team = domain.Team(metric_source_ids={self.__wiki: 'team'}) self.__project = domain.Project( metric_sources={metric_source.TeamSpirit: self.__wiki}) self.__metric = metric.TeamSpirit(subject=self.__team, project=self.__project)
def test_add_team(self): """ Test that a team can be added to the project. """ team = domain.Team() self.__project.add_team(team) self.assertEqual([team], self.__project.teams())
def test_teams(self): """ Test that the report contains the team section. """ team = domain.Team(name='Team') self.__project.add_team(team) quality_report = report.QualityReport(self.__project) self.assertEqual(2, len(quality_report.sections()))
def test_missing_value(self): """ Test that the value is -1 when the team id has not been configured. """ age = metric.TeamSpiritAge(subject=domain.Team(), project=self.__project) self.assertEqual(-1, age.value())
def test_team(self): """ Test that the report has 2 sections when we add a team. """ team = domain.Team(name='Team') self.__project.add_team(team) quality_report = report.QualityReport(self.__project) self.assertEqual(2, len(quality_report.sections()))
def __create_team(team_kwargs): """ Create a team according to the provided arguments. """ return domain.Team(name='Team', **team_kwargs)
def test_short_name(self): """ Test that the short name of the team can also be passed at initialization. """ team = domain.Team(name='ABC', short_name='ZZ') self.assertEqual('ZZ', team.short_name())
def test_eq(self): """ Test that teams are equal when their names are. """ self.assertEqual(self.__team, domain.Team(name='The A-team'))
def setUp(self): self.__team = domain.Team(name='The A-team')