mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Project global variables
This commit is contained in:
1 parent
80958e8a6d
commit
e267f8a8b8
9 files changed
+167
-8
No files matched your search
@@ -92,9 +92,29 @@ def test_changing_path_not_allowed(tmpdir):
|
||||
p.path = str(tmpdir)
|
||||
|
||||
|
||||
def test_variables(tmpdir):
|
||||
variables = [{"name": "VAR1", "value": "VAL1"}]
|
||||
p = Project(project_id=str(uuid4()), variables=variables)
|
||||
assert p.variables == variables
|
||||
|
||||
|
||||
def test_json(tmpdir):
|
||||
p = Project(project_id=str(uuid4()))
|
||||
assert p.__json__() == {"name": p.name, "project_id": p.id}
|
||||
assert p.__json__() == {
|
||||
"name": p.name,
|
||||
"project_id": p.id,
|
||||
"variables": None
|
||||
}
|
||||
|
||||
|
||||
def test_json_with_variables(tmpdir):
|
||||
variables = [{"name": "VAR1", "value": "VAL1"}]
|
||||
p = Project(project_id=str(uuid4()), variables=variables)
|
||||
assert p.__json__() == {
|
||||
"name": p.name,
|
||||
"project_id": p.id,
|
||||
"variables": variables
|
||||
}
|
||||
|
||||
|
||||
def test_node_working_directory(tmpdir, node):
|
||||
|
||||
Reference in new issue
Block a user