From 90361802c6edeb06ee86c8a9d731aafb0b52a2d7 Mon Sep 17 00:00:00 2001 From: mdoglio Date: Wed, 17 Apr 2013 18:43:14 +0100 Subject: [PATCH] add test_job_group_manager --- tests/model/derived/refdata.py | 19 ++++++++++++++++++- tests/model/derived/refdata_test.json | 7 +++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/model/derived/refdata.py b/tests/model/derived/refdata.py index 66cf203c0..e9a9c3c48 100644 --- a/tests/model/derived/refdata.py +++ b/tests/model/derived/refdata.py @@ -30,7 +30,7 @@ def test_build_platform_manager(refdata): 'linux', 'Fedora 12', 'x86_64',) - print build_platform_id + row_data = refdata.dhub.execute( proc="refdata_test.selects.test_build_platform_manager", placeholders=[build_platform_id] @@ -39,3 +39,20 @@ def test_build_platform_manager(refdata): assert row_data["os_name"] == 'linux' assert row_data["platform"] == 'Fedora 12' assert row_data["architecture"] == 'x86_64' + + +def test_job_group_manager(refdata): + # `name` = mygroup + + job_group_id = refdata.get_or_create_job_group('mygroup') + + row_data = refdata.dhub.execute( + proc="refdata_test.selects.test_job_group_manager", + placeholders=[job_group_id] + )[0] + + assert row_data["symbol"] == 'fill me' + assert row_data["name"] == 'mygroup' + assert row_data["description"] == 'fill me' + assert row_data["active_status"] == 'active' + diff --git a/tests/model/derived/refdata_test.json b/tests/model/derived/refdata_test.json index 7fbf788fd..0c1be1cbd 100644 --- a/tests/model/derived/refdata_test.json +++ b/tests/model/derived/refdata_test.json @@ -8,8 +8,11 @@ `id` = ?", "host":"read_host" }, - "show_tables":{ - "sql": "SHOW TABLES", + "test_job_group_manager":{ + "sql": "SELECT `symbol`, `name`, `description`, `active_status` + FROM `job_group` + WHERE + `id` = ?", "host":"read_host" } }