def test_override(): build_break_rules = config.get("build_break_rules").copy() golang_cmd = config.get("scan_tools_args_map").get("go") assert list(golang_cmd.keys()) == ["source-go", "staticcheck"] test_data_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data") config.set("SAST_SCAN_SRC_DIR", test_data_dir) config.reload() # Test if we are able to override the whole dict new_rules = config.get("build_break_rules") assert build_break_rules != new_rules # Test if we are able to override a command golang_cmd = config.get("scan_tools_args_map").get("go") assert golang_cmd[0] == "echo" assert config.get("scan_type") == "credscan,java"
def value(self, config, section="MEOS"): config.set(section, self.confSection + "Color", self.ColorButton.color.name()) config.set(section, self.confSection + "lineWidth", self.Grosor.value()) config.set(section, self.confSection + "lineStyle", self.Linea.currentValue()) config.set(section, self.confSection + "marker", self.Marca.currentValue()) return config
def start( host='http://localhost', port=9000, uuid=None, secret=None, username=None, password=None, organization=None, token=None, **kwargs): config.set(host=host, port=port) if uuid and secret: credentials.set_device_credentials(uuid, secret) elif username and password and organization: credentials.set_user_credentials(username, password, organization) elif token: credentials.set_token(token) socket.start(host, port, credentials.get_token())
def default(cls, config, confSection, section="MEOS"): config.set(section, confSection + "Color", "#000000") config.set(section, confSection + "lineWidth", "0.5") config.set(section, confSection + "lineStyle", "-") config.set(section, confSection + "marker", "None") return config
def value(self, config, section="MEOS"): config.set(section, self.confSection + "Color", self.ColorButton.color.name()) config.set(section, self.confSection + "lineWidth", str(self.Grosor.value())) config.set(section, self.confSection + "lineStyle", self.Linea.currentValue()) config.set(section, self.confSection + "marker", self.Marca.currentValue()) return config