File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,11 +70,10 @@ def test_lookup_and_initialize_pika_transport_layer():
7070
7171def test_add_command_line_help_optparse ():
7272 """Check that command line parameters are registered in the parser."""
73- parser = mock .MagicMock ()
73+ parser = mock .MagicMock (spec = optparse . OptionParser )
7474
7575 PikaTransport ().add_command_line_options (parser )
7676
77- parser .add_argument .assert_not_called ()
7877 parser .add_option .assert_called ()
7978 assert parser .add_option .call_count > 4
8079 for call in parser .add_option .call_args_list :
@@ -83,13 +82,11 @@ def test_add_command_line_help_optparse():
8382
8483def test_add_command_line_help_argparse ():
8584 """Check that command line parameters are registered in the parser."""
86- parser = mock .MagicMock ()
87- parser .add_argument = mock .Mock ()
85+ parser = mock .MagicMock (spec = argparse .ArgumentParser )
8886
8987 PikaTransport ().add_command_line_options (parser )
9088
9189 parser .add_argument .assert_called ()
92- parser .add_option .assert_not_called ()
9390 assert parser .add_argument .call_count > 4
9491 for call in parser .add_argument .call_args_list :
9592 assert inspect .isclass (call [1 ]["action" ])
Original file line number Diff line number Diff line change @@ -32,11 +32,10 @@ def test_lookup_and_initialize_stomp_transport_layer():
3232
3333def test_add_command_line_help_optparse ():
3434 """Check that command line parameters are registered in the parser."""
35- parser = mock .MagicMock ()
35+ parser = mock .MagicMock (spec = optparse . OptionParser )
3636
3737 StompTransport ().add_command_line_options (parser )
3838
39- parser .add_argument .assert_not_called ()
4039 parser .add_option .assert_called ()
4140 assert parser .add_option .call_count > 4
4241 for call in parser .add_option .call_args_list :
@@ -45,13 +44,11 @@ def test_add_command_line_help_optparse():
4544
4645def test_add_command_line_help_argparse ():
4746 """Check that command line parameters are registered in the parser."""
48- parser = mock .MagicMock ()
49- parser .add_argument = mock .Mock ()
47+ parser = mock .MagicMock (spec = argparse .ArgumentParser )
5048
5149 StompTransport ().add_command_line_options (parser )
5250
5351 parser .add_argument .assert_called ()
54- parser .add_option .assert_not_called ()
5552 assert parser .add_argument .call_count > 4
5653 for call in parser .add_argument .call_args_list :
5754 assert inspect .isclass (call [1 ]["action" ])
You can’t perform that action at this time.
0 commit comments