def test_is_local_overlay_enabled_enabled(self): _yaml = "local_overlay_enabled: True" _yaml_dict = {'local_overlay_enabled': True} _filename = "filename" self.yaml_read_patch(_yaml, _yaml_dict) self.assertTrue(lc_deploy.is_local_overlay_enabled(_filename)) self._open.assert_called_once_with(_filename, "r")
def test_is_local_overlay_enabled_disabled(self): _yaml = "local_overlay_enabled: False" _yaml_dict = {'local_overlay_enabled': False} _filename = "filename" self.yaml_read_patch(_yaml, _yaml_dict) self.assertFalse(lc_deploy.is_local_overlay_enabled(_filename)) self._open.assert_called_once_with(_filename, "r") self.yaml.safe_load.assert_called_once_with(_yaml)
def test_is_local_overlay_enabled_unset(self): _yaml = "testconfig: someconfig" _yaml_dict = {'test_config': 'someconfig'} _filename = "filename" self.yaml_read_patch(_yaml, _yaml_dict) self.assertTrue(lc_deploy.is_local_overlay_enabled(_filename)) self._open.assert_called_once_with(_filename, "r") self.yaml.safe_load.assert_called_once_with(_yaml)