def test_command_executed(self):
     collector = []
     scripts.run_command(create_somecommand(collector))
     self.assertIn(
         'executed',
         collector
     )
 def test_command_instantiated(self):
     collector = []
     scripts.run_command(create_somecommand(collector))
     self.assertIn(
         dict(env=dict(key='value')),
         collector
     )
 def test_command_result(self):
     self.assertEquals(
         'result',
         scripts.run_command(create_somecommand())
     )
 def test_args_parsed(self):
     scripts.run_command(create_somecommand())
     self.parser.parse_args.assert_called_once_with()
 def test_parser_acquired(self):
     command = create_somecommand()
     scripts.run_command(command)
     # pylint: disable=E
     scripts.get_parser_for.assert_called_once_with(command)
 def test_logging_configured(self):
     # pylint: disable=E
     scripts.run_command(create_somecommand())
     self.assertTrue(scripts.setup_logging.called)
    def test_env_can_be_injected(self):
        collector = []
        scripts.run_command(create_somecommand(collector), env=dict(k=1))

        self.assertEquals(dict(env=dict(k=1)), collector[0])