from nose.tools import eq_, ok_, raises
import unittest
import os
import string
import random
import datetime
from flask_appbuilder.console import create_app
from click.testing import CliRunner

import logging

logging.basicConfig(format='%(asctime)s:%(levelname)s:%(name)s:%(message)s')
logging.getLogger().setLevel(logging.DEBUG)
log = logging.getLogger(__name__)



class FlaskTestCase(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        log.debug("TEAR DOWN")

    def test_create_app(self):
        """
            Test create app
        """
        runner = CliRunner()
        result = runner.invoke(create_app, input='myapp\nSQLAlchemy\n')
        ok_('Downloaded the skeleton app, good coding!' in result.output)

        


@@ -103,16 +103,30 @@
 atetime%0A
+import shutil%0A
 from fla
@@ -765,16 +765,224 @@
 output)%0A
+        shutil.rmtree('myapp')%0A        result = runner.invoke(create_app, input='myapp%5CnMongoEngine%5Cn')%0A        ok_('Downloaded the skeleton app, good coding!' in result.output)%0A        shutil.rmtree('myapp')
 %0A       

test for fabmanager create-app