Example #1
0
 def test_17(self):
     main([
         '--configFile',
         "config.toml",
         "--inputDirectory",
         f"""{os.path.join(os.getcwd(), "input", "foo2")}""",
         '--trailingStringTemplateFile',
         '.template',
         f"--outputDirectory",
         f"""{os.path.join(os.getcwd(), "output/foo2")}""",
         '--format',
         'fstring',
     ])
Example #2
0
 def test_15(self):
     self.assertStdoutEqual(
         "Hello 1, 2, 3\n", lambda: main([
             '--configFile', "config.toml", '--format', 'python',
             '--writeOnStdout',
             """print("Hello " + ', '.join(map(str, [1,2,3])))"""
         ]))
Example #3
0
 def test_10(self):
     self.assertStdoutEqual(
         "Hello  a and  a and !", lambda: main([
             "--configFile", "config.toml", "--writeOnStdout", "--value",
             "persons[0].surname", "Mario", "--value", "persons[1].surname",
             "Paolo",
             "Hello {% for p in model.persons %} {{ functions.replace_with_a(p.surname) }} and {%endfor %}!"
         ]))
Example #4
0
 def test_09(self):
     self.assertStdoutEqual(
         "Hello Paolo!", lambda: main([
             '--configFile', "config.toml", '--format', 'format',
             '--writeOnStdout', "--value", "persons[0].surname", "Mario",
             "--value", "persons[1].surname", "Paolo",
             """Hello {model.persons[1].surname}!"""
         ]))
Example #5
0
 def test_04(self):
     self.assertStdoutEqual(
         "Hello  Mario and  Paolo and !", lambda: main([
             "--configFile", "config.toml", "--writeOnStdout", "--value",
             "persons[0].surname", "Mario", "--value", "persons[1].surname",
             "Paolo",
             "Hello {% for p in model.persons %} {{ p.surname }} and {%endfor %}!"
         ]))
Example #6
0
 def test_08(self):
     self.assertStdoutEqual(
         "Hello Pluto 042!", lambda: main([
             '--configFile', "config.toml", '--format', 'format',
             '--writeOnStdout', "Hello {model.name} {model.age:03}!"
         ]))
Example #7
0
 def test_03(self):
     self.assertStdoutEqual(
         "Hello World!!", lambda: main([
             "--configFile", "config.toml", "--writeOnStdout", "--value",
             "person.surname", "World!", "Hello {{ model.person.surname }}!"
         ]))
Example #8
0
 def test_01(self):
     self.assertStdoutEqual(
         "Hello Pluto!", lambda: main([
             '--configFile', "config.toml", '--writeOnStdout',
             "Hello {{ model.name }}!"
         ]))
Example #9
0
 def test_version(self):
     self.assertStdoutEqual(str(version.VERSION),
                            lambda: main(["test", "--version"]))
Example #10
0
 def test_14(self):
     self.assertStdoutEqual(
         "Hello Pluto!\n", lambda: main([
             '--configFile', "config.toml", '--format', 'python',
             '--writeOnStdout', """print(f'Hello {model.name}!')"""
         ]))
Example #11
0
 def test_13(self):
     self.assertStdoutEqual(
         "Hello a!", lambda: main([
             '--configFile', "config.toml", '--format', 'fstring',
             '--writeOnStdout', """'Hello {replace_with_a(model.name)}!'"""
         ]))
Example #12
0
 def test_12(self):
     self.assertStdoutEqual(
         "Hello Pluto!", lambda: main([
             '--configFile', "config.toml", '--format', 'fstring',
             '--writeOnStdout', """'Hello {model.name}!'"""
         ]))