def test_kube_config_worker_annotations_properly_parsed(self): annotations = KubeConfig().kube_annotations self.assertEqual({'iam.com/role': 'role-arn', 'other/annotation': 'value'}, annotations)
def test_kube_config_no_worker_annotations(self): annotations = KubeConfig().kube_annotations self.assertIsNone(annotations)
def test_delete_option_kwargs_config(self, config, expected_value): with conf_vars({ ('kubernetes', 'delete_option_kwargs'): config, }): self.assertEqual(KubeConfig().delete_option_kwargs, expected_value)
def test_worker_configuration_auth_both_ssh_and_user(self): with self.assertRaisesRegex(AirflowConfigException, 'either `git_user` and `git_password`.*' 'or `git_ssh_key_secret_name`.*' 'but not both$'): KubeConfig()