コード例 #1
0
ファイル: test_pytools.py プロジェクト: aroberge/plurilingue
 def test_round_trip(self):
     pytools.create_template("utf8_test.py", "junk.template")
     pytools.py2json("utf8_test.py", "junk.json")
     pytools.json2py("junk.json", "junk.template", "junk.py")
     self.assertTrue(filecmp.cmp("utf8_test.py", "junk.py", shallow=False))
     for f in ["junk.template", "junk.json", "junk.py"]:
         os.remove(f)
コード例 #2
0
ファイル: test_pytools.py プロジェクト: aroberge/plurilingue
 def test_create_file(self):
     pytools.create_template("utf8_test.py", "junk")
     self.assertTrue(filecmp.cmp("utf8_test.template", "junk", shallow=False))  # NOQA
     os.remove("junk")
コード例 #3
0
ファイル: test_pytools.py プロジェクト: aroberge/plurilingue
 def test_create_str(self):
     with open("utf8_test.template") as filename:
         content = filename.read()
     self.assertEqual(pytools.create_template("utf8_test.py"), content)