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")
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")
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")
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)
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)
def name(self, value): """ Name Setter """ ui.valid_filename(value) self._name = value
def name(self, value): ui.valid_filename(value) self._name = value