def test_get_cli_params(self): """ This @staticmethod should return a string. The function should work both with and without an application context """ cli = ConsulProvisioner.get_cli_params() self.assertIsInstance(cli, basestring) with create_app().app_context(): self.assertEqual(cli, ConsulProvisioner.get_cli_params()) # Delete the requires config value to see if the method tries to # access it. Expect KeyError with self.assertRaises(KeyError): del current_app.config["DEPENDENCIES"]["CONSUL"] ConsulProvisioner.get_cli_params()