Exemplo n.º 1
0
 def test_main(self):
     soa_dir = "paasta_maaaachine"
     with mock.patch("paasta_tools.cleanup_marathon_jobs.cleanup_apps",
                     autospec=True) as cleanup_patch:
         cleanup_marathon_jobs.main(("--soa-dir", soa_dir))
         cleanup_patch.assert_called_once_with(soa_dir,
                                               kill_threshold=0.5,
                                               force=False)
 def test_main(self):
     soa_dir = 'paasta_maaaachine'
     fake_args = mock.Mock(verbose=False, soa_dir=soa_dir)
     with contextlib.nested(
             mock.patch('paasta_tools.cleanup_marathon_jobs.parse_args',
                        return_value=fake_args),
             mock.patch('paasta_tools.cleanup_marathon_jobs.cleanup_apps')
     ) as (args_patch, cleanup_patch):
         cleanup_marathon_jobs.main()
         args_patch.assert_called_once_with()
         cleanup_patch.assert_called_once_with(soa_dir)
 def test_main(self):
     soa_dir = 'paasta_maaaachine'
     fake_args = mock.Mock(verbose=False, soa_dir=soa_dir)
     with contextlib.nested(
         mock.patch('paasta_tools.cleanup_marathon_jobs.parse_args', return_value=fake_args),
         mock.patch('paasta_tools.cleanup_marathon_jobs.cleanup_apps')
     ) as (
         args_patch,
         cleanup_patch
     ):
         cleanup_marathon_jobs.main()
         args_patch.assert_called_once_with()
         cleanup_patch.assert_called_once_with(soa_dir)
Exemplo n.º 4
0
 def test_main(self):
     soa_dir = 'paasta_maaaachine'
     fake_args = mock.Mock(verbose=False, soa_dir=soa_dir,
                           kill_threshold=0.5, force=False)
     with contextlib.nested(
         mock.patch('paasta_tools.cleanup_marathon_jobs.parse_args', return_value=fake_args, autospec=True),
         mock.patch('paasta_tools.cleanup_marathon_jobs.cleanup_apps', autospec=True),
     ) as (
         args_patch,
         cleanup_patch
     ):
         cleanup_marathon_jobs.main()
         args_patch.assert_called_once_with()
         cleanup_patch.assert_called_once_with(soa_dir, kill_threshold=0.5,
                                               force=False)
Exemplo n.º 5
0
 def test_main(self):
     soa_dir = 'paasta_maaaachine'
     fake_args = mock.Mock(verbose=False,
                           soa_dir=soa_dir,
                           kill_threshold=0.5,
                           force=False)
     with contextlib.nested(
             mock.patch('paasta_tools.cleanup_marathon_jobs.parse_args',
                        return_value=fake_args,
                        autospec=True),
             mock.patch('paasta_tools.cleanup_marathon_jobs.cleanup_apps',
                        autospec=True),
     ) as (args_patch, cleanup_patch):
         cleanup_marathon_jobs.main()
         args_patch.assert_called_once_with()
         cleanup_patch.assert_called_once_with(soa_dir,
                                               kill_threshold=0.5,
                                               force=False)