Example #1
0
def test_valid_filename():
    """ Test Valid FileName """
    with pytest.raises(Exception):
        ui.valid_filename("foo/bar")
    with pytest.raises(Exception):
        ui.valid_filename("..")
    ui.valid_filename("foo")
Example #2
0
def test_valid_filename():
    """ Test Valid FileName """
    with pytest.raises(Exception):
        ui.valid_filename("foo/bar")
    with pytest.raises(Exception):
        ui.valid_filename("..")
    ui.valid_filename("foo")
Example #3
0
def test_valid_filename():
    # pylint:disable-msg=E1101
    with pytest.raises(Exception):
        ui.valid_filename("foo/bar")
    # pylint:disable-msg=E1101
    with pytest.raises(Exception):
        ui.valid_filename("..")
    ui.valid_filename("foo")
Example #4
0
def test_valid_filename():
    # pylint:disable-msg=E1101
    with pytest.raises(Exception):
        ui.valid_filename("foo/bar")
    # pylint:disable-msg=E1101
    with pytest.raises(Exception):
        ui.valid_filename("..")
    ui.valid_filename("foo")
Example #5
0
def test_valid_filename():
    # pylint:disable-msg=E1101
    with pytest.raises(qisys.error.Error):
        ui.valid_filename("foo/bar")
    # pylint:disable-msg=E1101
    with pytest.raises(qisys.error.Error):
        ui.valid_filename("..")
    ui.valid_filename("foo")
Example #6
0
 def parse(self, tree):
     name = tree.get("name")
     if not name:
         qisys.qixml.raise_parse_error("'config' node must have a 'name' attribute",
             tree=tree)
     self.name = ui.valid_filename(name)
     self.ide = tree.get("ide")
     env_tree = tree.find("env")
     if env_tree is not None:
         self.env.parse(env_tree)
     cmake_tree = tree.find("cmake")
     if cmake_tree is not None:
         self.cmake.parse(cmake_tree)
     toolchain_elem = tree.find("toolchain")
     if toolchain_elem is not None:
         self.toolchain = toolchain_elem.text
     profiles_tree = tree.find("profiles")
     if profiles_tree is not None:
         profile_elems = profiles_tree.findall("profile")
         for profile_elem in profile_elems:
             self.profiles.append(profile_elem.text)
Example #7
0
 def parse(self, tree):
     name = tree.get("name")
     if not name:
         qisys.qixml.raise_parse_error(
             "'config' node must have a 'name' attribute", tree=tree)
     self.name = ui.valid_filename(name)
     self.ide = tree.get("ide")
     env_tree = tree.find("env")
     if env_tree is not None:
         self.env.parse(env_tree)
     cmake_tree = tree.find("cmake")
     if cmake_tree is not None:
         self.cmake.parse(cmake_tree)
     toolchain_elem = tree.find("toolchain")
     if toolchain_elem is not None:
         self.toolchain = toolchain_elem.text
     profiles_tree = tree.find("profiles")
     if profiles_tree is not None:
         profile_elems = profiles_tree.findall("profile")
         for profile_elem in profile_elems:
             self.profiles.append(profile_elem.text)
Example #8
0
 def name(self, value):
     """ Name Setter """
     ui.valid_filename(value)
     self._name = value
Example #9
0
 def name(self, value):
     ui.valid_filename(value)
     self._name = value
Example #10
0
 def name(self, value):
     ui.valid_filename(value)
     self._name = value