Exemple #1
0
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)
Exemple #2
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)
Exemple #3
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)
Exemple #4
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)
Exemple #5
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)
Exemple #6
0
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)
Exemple #7
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)
Exemple #8
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)
Exemple #9
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)
Exemple #10
0
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)
Exemple #11
0
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)
Exemple #12
0
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)
Exemple #13
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)
Exemple #14
0
def test_non_project():

    """Attempt to run a built-in without a .dtfini"""

    rtn = testutils.dtf("archive")
    assert(rtn.return_code == 253)
Exemple #15
0
def test_dtf():

    """Just attempt to run dtf"""

    rtn = testutils.dtf("")
    assert(rtn.return_code == 255)