Skip to content

Commit

Permalink
tests: use client_type in get_server
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Dec 8, 2023
1 parent 17f2029 commit c08f80f
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion examples/test/print.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from trame.ui.html import DivLayout
from trame.widgets import html

server = get_server()
server = get_server(client_type="vue3")

# Test to dynamically add a fake directive
html.Div.register_directive("v_seb_directive")
Expand Down
2 changes: 1 addition & 1 deletion examples/test/reactivity.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from trame.app import get_server
from trame_client.utils.testing import enable_testing

server = get_server()
server = get_server(client_type="vue3")
server.state.count = 1
server.state.trame__template_main = """
<div>
Expand Down
3 changes: 1 addition & 2 deletions examples/vue2/client_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from trame.widgets import html, client
from trame.ui.html import DivLayout

server = get_server()
server.client_type = "vue2"
server = get_server(client_type="vue2")
state, ctrl = server.state, server.controller

dyna_var_count = 1
Expand Down
3 changes: 1 addition & 2 deletions examples/vue2/core_reactive_state.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from trame.app import get_server

server = get_server()
server.client_type = "vue2" # default until trame>=3.x
server = get_server(client_type="vue2")
state, ctrl = server.state, server.controller

state.count = 2
Expand Down
3 changes: 1 addition & 2 deletions examples/vue2/dynamic_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from trame.ui.html import DivLayout
from trame_client.utils.testing import enable_testing

server = enable_testing(get_server(), "count")
server.client_type = "vue2"
server = enable_testing(get_server(client_type="vue2"), "count")
state, ctrl = server.state, server.controller

state.count = 1
Expand Down
3 changes: 1 addition & 2 deletions examples/vue2/getter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# Trame setup
# -----------------------------------------------------------------------------

server = get_server()
server.client_type = "vue2"
server = get_server(client_type="vue2")
state, ctrl = server.state, server.controller

state.message_1 = "Hello 1"
Expand Down
3 changes: 1 addition & 2 deletions examples/vue2/js_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from trame.ui.html import DivLayout
from trame_client.utils.testing import enable_testing

server = enable_testing(get_server(), "message")
server.client_type = "vue2"
server = enable_testing(get_server(client_type="vue2"), "message")
state, ctrl = server.state, server.controller


Expand Down
3 changes: 1 addition & 2 deletions examples/vue2/life_cycle.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from trame.app import get_server

server = get_server()
server.client_type = "vue2"
server = get_server(client_type="vue2")
ctrl = server.controller
server.state.trame__template_main = "Life Cycle App"

Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/client_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from trame.widgets import html, client
from trame.ui.html import DivLayout

server = get_server()
server.client_type = "vue3"
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller

dyna_var_count = 1
Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/core_reactive_state.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from trame.app import get_server

server = get_server()
server.client_type = "vue3"
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller

state.count = 2
Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/dynamic_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from trame.ui.html import DivLayout
from trame_client.utils.testing import enable_testing

server = get_server()
server.client_type = "vue3"
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller

state.count = 1
Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/getter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# Trame setup
# -----------------------------------------------------------------------------

server = get_server()
server.client_type = "vue3"
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller

state.message_1 = "Hello 1"
Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/js_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from trame.ui.html import DivLayout
from trame_client.utils.testing import enable_testing

server = enable_testing(get_server(), "message")
server.client_type = "vue3"
server = enable_testing(get_server(client_type="vue3"), "message")
state, ctrl = server.state, server.controller


Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/life_cycle.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from trame.app import get_server

server = get_server()
server.client_type = "vue3"
server = get_server(client_type="vue3")
ctrl = server.controller
server.state.trame__template_main = "Life Cycle App"

Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pixelmatch
Pillow
pytest-xprocess
trame
trame-server>=2.13.0
trame-server>=2.13.1

0 comments on commit c08f80f

Please sign in to comment.