def test_help(): """Attempt to print help/useage""" rtn = testutils.dtf("--help") assert(rtn.return_code == 0) rtn = testutils.dtf("-h") assert(rtn.return_code == 0) rtn = testutils.dtf("help") assert(rtn.return_code == 0)
def test_version(): """Attempt to obtain version""" rtn = testutils.dtf("--version") assert(rtn.return_code == 0) rtn = testutils.dtf("-v") assert(rtn.return_code == 0) rtn = testutils.dtf("version") assert(rtn.return_code == 0)
def test_no_args(): """Running del with no args""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("prop del") testutils.undeploy() assert (rtn.return_code == 0)
def test_reset_real(): """Perform a reset""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("reset", input_data="y\n") testutils.undeploy() assert (rtn.return_code == 0)
def test_reset_bail(): """Attempt a reset but decline""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("reset", input_data="n\n") testutils.undeploy() assert (rtn.return_code == 255)
def test_set_a_prop(): """Set an arbitrary property""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("prop set Info magic AbraKadabra") testutils.undeploy() assert (rtn.return_code == 0)
def test_not_subcommand(): """Call invalid subcommand""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("prop NON_EXIST") testutils.undeploy() assert(rtn.return_code == 0)
def test_test_invalid_prop(): """Test an invalid property""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("prop test Info magic") testutils.undeploy() assert(rtn.return_code == 0)
def test_get_invalid_prop(): """Get a non-existing property""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("prop get Info magic") testutils.undeploy() assert(rtn.return_code == 255)
def test_python_load_imp_exception(): """Attempt to run builtin and fail to parse load_imp""" testutils.deploy_config_raw("") rtn = testutils.dtf("status") testutils.undeploy() assert(rtn.return_code == 247)
def test_python_precheck_sdk_missing(): """Attempt to run python module with missing SDK""" testutils.deploy_config_raw("") rtn = testutils.dtf("archive") testutils.undeploy() assert(rtn.return_code == 248)
def test_del_valid_prop(): """Delete a valid property""" config = testutils.get_default_config() config.set("Info", "magic", "AbraKadabra") testutils.deploy_config(config) rtn = testutils.dtf("prop del Info magic") testutils.undeploy() assert (rtn.return_code == 0)
def test_no_args(): """Run with not args""" testutils.deploy_config(testutils.get_default_config()) example_local = "%s/example" % utils.LOCAL_MODULES_DIRECTORY utils.touch(example_local) rtn = testutils.dtf("local") testutils.undeploy() assert (rtn.return_code == 0)
def test_non_project(): """Attempt to run a built-in without a .dtfini""" rtn = testutils.dtf("archive") assert(rtn.return_code == 253)
def test_dtf(): """Just attempt to run dtf""" rtn = testutils.dtf("") assert(rtn.return_code == 255)