class_docstr: Test that a deprecated api signature for add_cmdline_args is not accepted.
class_docstr_tok: ["Test","that","a","deprecated","api","signature","for","add_cmdline_args","is","not","accepted","."]
code: def test_good_agent(self):
      from parlai.core.agents import register_agent
  
      @register_agent("partialopt_addcmdlineargs_agent")
      class TestAgent:
          @classmethod
          def add_cmdline_args(cls, argparser, partial_opt=None):
              argparser.add_argument(
                  "--yes-find", default=True, type="bool"
              )
              if partial_opt and partial_opt.get("yes_find"):
                  # conditional argument addition
                  argparser.add_argument(
                      "--yes-partial-find", default=True, type="bool"
                  )
              return argparser
  
      opt = ParlaiParser(True, True).parse_kwargs(
          model="partialopt_addcmdlineargs_agent",
          task="integration_tests",
      )
      assert "yes_find" in opt
      assert "yes_partial_find" in opt
  
      # don't trigger the partial opt dynamic add. we shouldn't find the subarg.
      opt = ParlaiParser(True, True).parse_kwargs(
          model="partialopt_addcmdlineargs_agent",
          task="integration_tests",
          yes_find=False,
      )
      assert "yes_find" in opt
      assert "yes_partial_find" not in opt
  
imports: import os
  import json
  import unittest
  from parlai.core.params import ParlaiParser
  import parlai.core.agents
  import parlai.utils.testing
label_desc: Use image node_id 2 for calling the TestAddCmdlineArgs obj's underlying member method code with example usage: obj.test_good_agent() and returns: argparser