def test_load_config_with_default(self, load_from_dict, load_from_file):
        string_pack_config.load_config()

        load_from_dict.assert_not_called()
        load_from_file.assert_called_once()
        self.assertEqual("default_config.json",
                         os.path.basename(load_from_file.call_args[0][0]))
    def test_load_config_with_config_file(self, load_from_dict,
                                          load_from_file):
        config_file = "test_config.json"
        string_pack_config.load_config(config_json_file_path=config_file)

        load_from_dict.assert_not_called()
        self.assertTrue(2, load_from_file.method_calls)
        load_from_file.assert_called_with(config_file)
예제 #3
0
def main():
    arg_parser = argparse.ArgumentParser()
    arg_parser.add_argument("--config", help="Location of JSON config file.")

    args = arg_parser.parse_args()
    sp_config = string_pack_config.load_config(config_json_file_path=args.config)

    pack_strings(sp_config, noop_plural_handler)
예제 #4
0
def main():
    logging.basicConfig(level=logging.INFO)
    arg_parser = argparse.ArgumentParser()
    arg_parser.add_argument("--config", help="Location of JSON config file.")
    arg_parser.add_argument("--keep-dest", action="store_true")
    args = arg_parser.parse_args()

    sp_config = string_pack_config.load_config(
        config_json_file_path=args.config)
    move_all_strings(sp_config, args.keep_dest)
예제 #5
0
def main():
    logging.basicConfig(level=logging.INFO)

    arg_parser = create_arg_parser()

    args = arg_parser.parse_args()

    sp_config = string_pack_config.load_config(config_json_file_path=args.config)

    find_movable_strings.find_movable_strings(sp_config, print_reverse=False)
    move_strings_for_packing.move_all_strings(sp_config, keep_dest=True)
    pack_strings.pack_strings(sp_config, pack_strings.noop_plural_handler)
예제 #6
0
def main():
    parser = argparse.ArgumentParser(description="Find strings to move to string packs")
    parser.add_argument(
        "--reverse",
        action="store_true",
        help="List the strings that cannot be moved, instead of those that can be moved.",
    )

    parser.add_argument("--config", help="Location of JSON config file.")
    args = parser.parse_args()

    sp_config = string_pack_config.load_config(config_json_file_path=args.config)
    find_movable_strings(sp_config, args.reverse)
    def test_load_config_with_dictionary(self, load_from_dict, load_from_file):
        config_dict = {"key": "value"}
        string_pack_config.load_config(config_dict, skip_default_config=True)

        load_from_dict.assert_called_once_with(config_dict)
        load_from_file.assert_not_called()