def test_parse_yaml_file(self):
        mock_open = self.mock_open("key: value")

        with mock.patch('fuelclient.utils.io.open', mock_open):
            self.assertEqual(
                utils.parse_yaml_file('some_file_name'),
                {'key': 'value'})
Beispiel #2
0
 def take_action(self, parsed_args):
     data = self.client.get_attributes_metadata_by_id(parsed_args.id)
     new_repos = utils.parse_yaml_file(parsed_args.file)
     data["editable"]["repo_setup"]["repos"]["value"] = new_repos
     self.client.update_attributes_metadata_by_id(parsed_args.id, data)
     self.app.stdout.write("Repositories for the release with "
                           "id {rel_id} were set from {file}.\n".format(
                               rel_id=parsed_args.id,
                               file=parsed_args.file))
    def test_parse_yaml_file(self):
        mock_open = self.mock_open("key: value")

        with mock.patch("fuelclient.utils.io.open", mock_open):
            self.assertEqual(utils.parse_yaml_file("some_file_name"), {"key": "value"})