def test_get_burn_in_builds_partial_patches(self):
     projects = Projects(PROJECT_PATCHES)
     version_builds = VersionBuilds(VERSION_BUILDS)
     evg_api = Mock()
     evg_api.project_patches_gen = projects._project_patches_gen
     evg_api.version_builds = version_builds._version_builds
     project = "another_project"
     days = 30000
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(3, len(burn_in_builds))
     days = 300000  # Go further back in time to pull in more patch builds.
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(4, len(burn_in_builds))
 def test_get_burn_in_builds_partial_patches(self):
     projects = Projects(PROJECT_PATCHES)
     version_builds = VersionBuilds(VERSION_BUILDS)
     evg_api = Mock()
     evg_api.project_patches_gen = projects._project_patches_gen
     evg_api.version_builds = version_builds._version_builds
     project = "another_project"
     days = 30000
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(3, len(burn_in_builds))
     days = 300000  # Go further back in time to pull in more patch builds.
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(4, len(burn_in_builds))
 def test_get_burn_in_builds_no_patches(self):
     version_builds = VersionBuilds(VERSION_BUILDS)
     evg_api = Mock()
     evg_api.project_patches_gen = lambda _: []
     evg_api.version_builds = version_builds._version_builds
     project = "myproject"
     days = 30000
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(0, len(burn_in_builds))
 def test_get_burn_in_builds_no_patches(self):
     version_builds = VersionBuilds(VERSION_BUILDS)
     evg_api = Mock()
     evg_api.project_patches_gen = lambda _: []
     evg_api.version_builds = version_builds._version_builds
     project = "myproject"
     days = 30000
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(0, len(burn_in_builds))
 def test_get_burn_in_builds_missing_patch(self):
     projects = Projects(PROJECT_PATCHES)
     version_builds = VersionBuilds(VERSION_BUILDS)
     evg_api = Mock()
     evg_api.project_patches_gen = projects._project_patches_gen
     evg_api.version_builds = version_builds._version_builds
     project = "another_project"
     days = 30000
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(3, len(burn_in_builds))
 def test_get_burn_in_builds_missing_patch(self):
     projects = Projects(PROJECT_PATCHES)
     version_builds = VersionBuilds(VERSION_BUILDS)
     evg_api = Mock()
     evg_api.project_patches_gen = projects._project_patches_gen
     evg_api.version_builds = version_builds._version_builds
     project = "another_project"
     days = 30000
     burn_in_builds = burn_in.get_burn_in_builds(evg_api, project, days)
     self.assertEqual(3, len(burn_in_builds))