def test_get_monitoring_config_value_with_defaults(self): expected = None with contextlib.nested( mock.patch('service_configuration_lib.read_service_configuration', autospec=True, return_value=self.empty_job_config), mock.patch('monitoring_tools.read_monitoring_config', autospec=True, return_value=self.empty_monitor_config), mock.patch('monitoring_tools.load_system_paasta_config', autospec=True), ) as ( service_configuration_lib_patch, read_monitoring_patch, load_system_paasta_config_patch, ): load_system_paasta_config_patch.return_value.get_cluster = mock.Mock(return_value='fake_cluster') actual = monitoring_tools.get_team(self.overrides, self.service, self.soa_dir) assert expected == actual service_configuration_lib_patch.assert_called_once_with(self.service, soa_dir=self.soa_dir) read_monitoring_patch.assert_called_once_with(self.service, soa_dir=self.soa_dir)
def get_owner(self): overrides = self.get_monitoring() return monitoring_tools.get_team(overrides=overrides, service=self.get_service())
def test_get_team(self): with mock.patch('monitoring_tools.__get_monitoring_config_value') as get_monitoring_config_value_patch: monitoring_tools.get_team(self.overrides, self.service, self.soa_dir) get_monitoring_config_value_patch.assert_called_once_with('team', self.overrides, self.service, self.soa_dir)