示例#1
0
文件: test_prop.py 项目: 5l1v3r1/dtf
def test_del_property():
    """Attempts to delete a valid property"""

    contents = ("[Info]\n" "sdk = 23")

    testutils.deploy_config_raw(contents)

    prop.del_prop('info', 'sdk')

    testutils.undeploy()

    return 0
示例#2
0
文件: test_prop.py 项目: 5l1v3r1/dtf
def test_del_property_casing():
    """Delete a prop with alternating casing"""

    sdk = '23'
    contents = ("[Info]\n" "sdk = %s" % sdk)

    testutils.deploy_config_raw(contents)

    prop.del_prop('info', 'sdk')

    testutils.undeploy()

    return 0
示例#3
0
文件: client.py 项目: heeeeen/dtf
    def do_remove(self):

        """Uninstall the dtf client"""

        log.i(self.name, "Waiting for device to be connected...")
        self.adb.wait_for_device()

        log.i(self.name, "Removing dtf client...")
        self.adb.uninstall(DTF_CLIENT)

        prop.del_prop("Info", "busybox")

        log.i(self.name, "dtf client removed!")

        return 0
示例#4
0
    def do_remove(self):

        """Uninstall the dtf client"""

        log.i(self.name, "Waiting for device to be connected...")
        self.adb.wait_for_device()

        log.i(self.name, "Removing dtf client...")
        self.adb.uninstall(DTF_CLIENT)

        prop.del_prop('Info', 'busybox')

        log.i(self.name, "dtf client removed!")

        return 0
示例#5
0
文件: test_prop.py 项目: 5l1v3r1/dtf
def test_del_empty_config():
    """Attempts to delete a property without a valid config"""

    testutils.deploy_config_raw("")

    assert prop.del_prop('info', 'sdk') != 0

    testutils.undeploy()

    return 0
示例#6
0
文件: test_prop.py 项目: 5l1v3r1/dtf
def test_del_property_invalid():
    """Attempts to delete a property that doesnt exist"""

    contents = ("[Info]\n" "vmtype = 64")

    testutils.deploy_config_raw(contents)

    assert prop.del_prop('info', 'sdk') != 0

    testutils.undeploy()

    return 0
示例#7
0
    def do_del(self, args):
        """Delete a property"""

        rtn = 0

        if len(args) != 2:
            log.e(self.name, "A section and property must be specified.")
            rtn = self.usage()

        else:
            section = args[0]
            prop_name = args[1]

            rtn = del_prop(section, prop_name)

        return rtn
示例#8
0
文件: prop.py 项目: Andy10101/dtf
    def do_del(self, args):

        """Delete a property"""

        rtn = 0

        if len(args) != 2:
            log.e(self.name, "A section and property must be specified.")
            rtn = self.usage()

        else:
            section = args[0]
            prop_name = args[1]

            rtn = del_prop(section, prop_name)

        return rtn