Loading src/climax/__main__.py +9 −1 Original line number Diff line number Diff line Loading @@ -810,7 +810,8 @@ def bundles_remove( keep_bundles[active_bundle_name] = active_bundle_url config.bundles = keep_bundles config.write() bundles_list() _sync_max_instance(directory, verbose=False) bundles_list(directory) @app.command(help=_("Ajoute un fichier ou un dossier XML")) Loading Loading @@ -1012,6 +1013,13 @@ def cache_clear(): shutil.rmtree(Path(USER_MAX_DIR, "max"), ignore_errors=True) @app.command(help=_("Affiche la version de climax")) def version(): import climax print(climax.__version__) if os.environ.get("CLIMAX_DEBUG") == "True": @app.command(help=_("Planter Climax")) Loading src/climax/locales/en/LC_MESSAGES/messages.mo +16 B (457 B) File changed.No diff preview for this file type. View original file View changed file tests.py +86 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ from pathlib import Path import tempfile import subprocess TEST_CONFIG_FILE = "tests_assets/max_config.xml" TEST_CONFIG_EMPTY_FILE = "tests_assets/empty_max_config.xml" TEST_CONFIG_FILE_BAD_ROOT = "tests_assets/bad_root_max_config.xml" Loading Loading @@ -56,10 +57,92 @@ class TestConfigFiles(unittest.TestCase): self.assertTrue(Path(tmpdir, ".max").is_dir()) p = subprocess.run(["climax", "projects"], stdout=subprocess.PIPE) self.assertTrue(tmpdir in p.stdout.decode("utf-8")) p = subprocess.run( ["climax", "info", "--directory", tmpdir], stdout=subprocess.PIPE # p = subprocess.run( # ["climax", "info", "--directory", tmpdir], stdout=subprocess.PIPE # ) # print(p.stdout.decode("utf-8")) def test_bundles_add_remove(self): with tempfile.TemporaryDirectory() as tmpdir: max_test_dir = Path(tmpdir).resolve() # make new max instance and test default bundles subprocess.run(["climax", "new", tmpdir], stdout=subprocess.PIPE) self.assertTrue( Path(max_test_dir, ".max/basex/webapp/max/bundles/max-dev").exists() ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dumb-xml" ).exists() ) self.assertTrue( Path(max_test_dir, ".max/basex/webapp/max/bundles/max-export").exists() ) # remove all bundles subprocess.run( ["climax", "bundles-remove", "max-dev", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dev/.ignore" ).exists() ) subprocess.run( [ "climax", "bundles-remove", "max-dumb-xml", "--directory", max_test_dir, ], stdout=subprocess.PIPE, ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dumb-xml/.ignore" ).exists() ) subprocess.run( ["climax", "bundles-remove", "max-export", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-export/.ignore" ).exists() ) # add previously removed bundles subprocess.run( ["climax", "bundles-add", "max-dev", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertFalse( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dev/.ignore" ).exists() ) subprocess.run( ["climax", "bundles-add", "max-dumb-xml", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertFalse( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dumb-xml/.ignore" ).exists() ) subprocess.run( ["climax", "bundles-add", "max-export", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertFalse( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-export/.ignore" ).exists() ) print(p.stdout.decode("utf-8")) if __name__ == "__main__": Loading Loading
src/climax/__main__.py +9 −1 Original line number Diff line number Diff line Loading @@ -810,7 +810,8 @@ def bundles_remove( keep_bundles[active_bundle_name] = active_bundle_url config.bundles = keep_bundles config.write() bundles_list() _sync_max_instance(directory, verbose=False) bundles_list(directory) @app.command(help=_("Ajoute un fichier ou un dossier XML")) Loading Loading @@ -1012,6 +1013,13 @@ def cache_clear(): shutil.rmtree(Path(USER_MAX_DIR, "max"), ignore_errors=True) @app.command(help=_("Affiche la version de climax")) def version(): import climax print(climax.__version__) if os.environ.get("CLIMAX_DEBUG") == "True": @app.command(help=_("Planter Climax")) Loading
src/climax/locales/en/LC_MESSAGES/messages.mo +16 B (457 B) File changed.No diff preview for this file type. View original file View changed file
tests.py +86 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ from pathlib import Path import tempfile import subprocess TEST_CONFIG_FILE = "tests_assets/max_config.xml" TEST_CONFIG_EMPTY_FILE = "tests_assets/empty_max_config.xml" TEST_CONFIG_FILE_BAD_ROOT = "tests_assets/bad_root_max_config.xml" Loading Loading @@ -56,10 +57,92 @@ class TestConfigFiles(unittest.TestCase): self.assertTrue(Path(tmpdir, ".max").is_dir()) p = subprocess.run(["climax", "projects"], stdout=subprocess.PIPE) self.assertTrue(tmpdir in p.stdout.decode("utf-8")) p = subprocess.run( ["climax", "info", "--directory", tmpdir], stdout=subprocess.PIPE # p = subprocess.run( # ["climax", "info", "--directory", tmpdir], stdout=subprocess.PIPE # ) # print(p.stdout.decode("utf-8")) def test_bundles_add_remove(self): with tempfile.TemporaryDirectory() as tmpdir: max_test_dir = Path(tmpdir).resolve() # make new max instance and test default bundles subprocess.run(["climax", "new", tmpdir], stdout=subprocess.PIPE) self.assertTrue( Path(max_test_dir, ".max/basex/webapp/max/bundles/max-dev").exists() ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dumb-xml" ).exists() ) self.assertTrue( Path(max_test_dir, ".max/basex/webapp/max/bundles/max-export").exists() ) # remove all bundles subprocess.run( ["climax", "bundles-remove", "max-dev", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dev/.ignore" ).exists() ) subprocess.run( [ "climax", "bundles-remove", "max-dumb-xml", "--directory", max_test_dir, ], stdout=subprocess.PIPE, ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dumb-xml/.ignore" ).exists() ) subprocess.run( ["climax", "bundles-remove", "max-export", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertTrue( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-export/.ignore" ).exists() ) # add previously removed bundles subprocess.run( ["climax", "bundles-add", "max-dev", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertFalse( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dev/.ignore" ).exists() ) subprocess.run( ["climax", "bundles-add", "max-dumb-xml", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertFalse( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-dumb-xml/.ignore" ).exists() ) subprocess.run( ["climax", "bundles-add", "max-export", "--directory", max_test_dir], stdout=subprocess.PIPE, ) self.assertFalse( Path( max_test_dir, ".max/basex/webapp/max/bundles/max-export/.ignore" ).exists() ) print(p.stdout.decode("utf-8")) if __name__ == "__main__": Loading