Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_define2str():
assert define2str('test',2) == '-def test="2"'
assert define2str('Test','Main.MyStudy') == '-def Test="Main.MyStudy"'
assert define2str('test','"This is a string"') == '-def test=---"\\"This is a string\\""'
def test_define2str():
assert define2str('test',2) == '-def test="2"'
assert define2str('Test','Main.MyStudy') == '-def Test="Main.MyStudy"'
assert define2str('test','"This is a string"') == '-def test=---"\\"This is a string\\""'
def test_define2str():
assert define2str('test',2) == '-def test="2"'
assert define2str('Test','Main.MyStudy') == '-def Test="Main.MyStudy"'
assert define2str('test','"This is a string"') == '-def test=---"\\"This is a string\\""'
def get_macro(self, index, **kwarg):
cmd = ['load "{}"'.format(self.filename)]
for key in sorted(self.defs):
value = self.defs[key]
cmd.append(define2str(key, value))
for key in sorted(self.paths):
value = self.paths[key]
cmd.append(path2str(key, value))
return " ".join(cmd)