Changeset 54ac968 in nscp for scripts/python/test.py


Ignore:
Timestamp:
08/10/11 15:05:59 (22 months ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
afd42f1
Parents:
04ef932
Message:

2011-08-10

  • Fixed linus issues and defect
  • Fixed some issues in the test python script regarding how prefix is handled
  • Fixed PythonScript module to actually use the correct function map :)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/python/test.py

    r04ef932 r54ac968  
    33core = Core.get() 
    44 
     5prefix = 'py_' 
    56def test(arguments): 
    67  log('inside test') 
    78  for a in arguments: 
    89    log('Got argument: %s'%a) 
    9   (retcode, msg, perf) = core.simple_query("normal", []) 
     10  (retcode, msg, perf) = core.simple_query("%snormal"%prefix, []) 
    1011  if msg != "ok got: ": 
    1112    return (status.CRITICAL, "Test failed") 
    12   (retcode, msg, perf) = core.simple_query("normal", ["hello"]) 
     13  (retcode, msg, perf) = core.simple_query("%snormal"%prefix, ["hello"]) 
    1314  if msg != "ok got: hello": 
    1415    return (status.CRITICAL, "Test failed") 
    15   (retcode, msg, perf) = core.simple_query("normal", ["hello", "world"]) 
     16  (retcode, msg, perf) = core.simple_query("%snormal"%prefix, ["hello", "world"]) 
    1617  if perf != "'args'=2": 
    1718    return (status.CRITICAL, "Test failed: -%s-"%perf) 
     
    4445   
    4546def init(alias): 
    46   prefix = 'py_' 
    4747  if alias: 
    4848    prefix = '%s_'%alias 
Note: See TracChangeset for help on using the changeset viewer.