コード例 #1
0
    def test_created_app_persists(self):
        rv = self.login("testuser", "password")

        # import readline # optional, will allow Up/Down/History in the console
        # import code
        # vars = globals().copy()
        # vars.update(locals())
        # shell = code.InteractiveConsole(vars)
        # shell.interact()

        # Create an App for the tests.
        self.tapp = api.create_app("UTApp", "dummy", None, "{}")
        self.tapp = api.get_app_by_name("UTApp")
        api.set_var(self.tapp, "TestVar", "TestValue")

        rv = self.login("testuser", "password")
        app = api.get_app_by_name("UTApp")

        assert app is not None

        vars = api.get_all_vars(app)

        assert len(vars) == 1

        var = vars[0]

        assert var.name == "TestVar"
        assert var.value == "TestValue"
コード例 #2
0
    def test_created_app_persists(self):
        rv = self.login("testuser", "password")

        # import readline # optional, will allow Up/Down/History in the console
        # import code
        # vars = globals().copy()
        # vars.update(locals())
        # shell = code.InteractiveConsole(vars)
        # shell.interact()

        # Create an App for the tests.
        self.tapp = api.create_app("UTApp", "dummy", None, "{}")
        self.tapp = api.get_app_by_name("UTApp")
        api.set_var(self.tapp, "TestVar", "TestValue")

        rv = self.login("testuser", "password")
        app = api.get_app_by_name("UTApp")

        assert app is not None

        vars = api.get_all_vars(app)

        assert len(vars) == 1

        var = vars[0]

        assert var.name == "TestVar"
        assert var.value == "TestValue"
コード例 #3
0
    def test_update_var(self):
        var = api.add_var(self.tapp, "TestVar1", "TestValue1")

        assert var.value == "TestValue1"

        api.set_var(self.tapp, "TestVar1", "NewValue")
        assert var.value == "NewValue"
コード例 #4
0
    def test_update_var(self):
        var = api.add_var(self.tapp, "TestVar1", "TestValue1")

        assert var.value == "TestValue1"

        api.set_var(self.tapp, "TestVar1", "NewValue")
        assert var.value == "NewValue"
コード例 #5
0
ファイル: __init__.py プロジェクト: zstars/appcomposer
def test(appid):
    # Remove all existing testvars.
    for v in get_all_vars(appid):
        remove_var(v)

    add_var(appid, "testvar", "Test Value")
    vars = get_all_vars(appid)

    var = set_var(appid, "testvar", "Hello")

    return repr(vars)
コード例 #6
0
ファイル: __init__.py プロジェクト: gengivan/appcomposer
def test(appid):
    # Remove all existing testvars.
    for v in get_all_vars(appid):
        remove_var(v)

    add_var(appid, "testvar", "Test Value")
    vars = get_all_vars(appid)

    var = set_var(appid, "testvar", "Hello")

    return repr(vars)
コード例 #7
0
    def setUp(self):
        appcomposer.app.config["DEBUG"] = True
        appcomposer.app.config["TESTING"] = True
        appcomposer.app.config["CSRF_ENABLED"] = False
        appcomposer.app.config["SECRET_KEY"] = "secret"

        self._cleanup()

        self.flask_app = appcomposer.app.test_client()
        with self.flask_app:
            rv = self.login("testuser", "password")

            # import readline # optional, will allow Up/Down/History in the console
            # import code
            # vars = globals().copy()
            # vars.update(locals())
            # shell = code.InteractiveConsole(vars)
            # shell.interact()

            # Create an App for the tests.
            self.tapp = api.create_app("UTApp", "dummy", None, "{}")
            self.tapp = api.get_app_by_name("UTApp")
            api.set_var(self.tapp, "TestVar", "TestValue")