def test_edit_config_rpc(self):
        runner = ysanity.Runner()
        runner.ydktest_sanity_one.number = 1
        runner.ydktest_sanity_one.name = 'runner:one:name'

        runner_xml = self.cs.encode(self.csp, runner)
        filter_xml = self.cs.encode(self.csp, ysanity.Runner())

        # Edit Config
        edit_rpc = ietf_netconf.EditConfig()
        edit_rpc.input.target.candidate = Empty()
        edit_rpc.input.config = runner_xml
        reply = self.es.execute_rpc(self.ncc, edit_rpc)
        self.assertIsNone(reply)

        # Get Config
        get_config_rpc = ietf_netconf.GetConfig()
        get_config_rpc.input.source.candidate = Empty()
        get_config_rpc.input.filter = filter_xml
        reply = self.es.execute_rpc(self.ncc, get_config_rpc, runner)
        self.assertIsNotNone(reply)
        self.assertEqual(reply, runner)

        # Commit
        commit_rpc = ietf_netconf.Commit()
        reply = self.es.execute_rpc(self.ncc, commit_rpc)
        self.assertIsNone(reply)

        # Get
        get_rpc = ietf_netconf.Get()
        get_rpc.input.filter = filter_xml
        reply = self.es.execute_rpc(self.ncc, get_rpc, runner)
        self.assertIsNotNone(reply)
        self.assertEqual(reply, runner)
    def test_execute_rpc_invalid_1(self):
        runner = ysanity.Runner()
        runner.ydktest_sanity_one.number = 1
        runner.ydktest_sanity_one.name = 'runner:one:name'

        edit_rpc = ietf_netconf.EditConfig()
        edit_rpc.input.target.candidate = Empty()
        runner_xml = self.codec.encode(self.codec_provider, runner)
        edit_rpc.input.config = runner_xml
        try:
            op = self.executor.execute_rpc(None, edit_rpc)
        except YServiceError as err:
            expected_msg = "provider and entity cannot be None"
            self.assertEqual(err.message, expected_msg)
        else:
            raise Exception('YServiceError not raised')