Repository: nagisc007/storybuilder

Issue:
Implement: info output
No output currently
===

**Description**
現在infoは出力内容がないので、そこを修正


Discussion:

Patch:
diff --git a/builder/tools.py b/builder/tools.py
index 07349c4..f196f9a 100644
--- a/builder/tools.py
+++ b/builder/tools.py
@@ -66,7 +66,7 @@ def output_story(story: ActionGroup, filename: str, is_action_data: bool=False,
         is_info_data: bool=False,
         is_out_as_file: bool=False, is_out_chars: bool=False,
         pri_filter: int=Action.MIN_PRIORITY,
-        is_debug: bool=False):
+        is_debug: bool=False): # pragma: no cover
     '''Output a story.
 
     Args:
@@ -99,7 +99,8 @@ def output_story(story: ActionGroup, filename: str, is_action_data: bool=False,
         ret = _output_story_to_file(
                 story_data, filename, suffix, is_debug)
         if is_info_data:
-            _output_story_to_file(["info data", "wip"],
+            _output_story_to_file(
+                    _story_info_data_converted(story, is_debug),
                     filename, "_i", is_debug)
         return ret
     else:
@@ -108,7 +109,8 @@ def output_story(story: ActionGroup, filename: str, is_action_data: bool=False,
             story_data += _story_flags_info_converted(story)
         ret =  _output_story_to_console(story_data, is_debug)
         if is_info_data:
-            _output_story_to_console(["info data", "wip"],
+            _output_story_to_console(
+                    _story_info_data_converted(story, is_debug),
                     is_debug)
         return ret
 
@@ -522,8 +524,9 @@ def _story_info_data_converted(story: ActionGroup, is_debug: bool) -> list:
     assert_isclass(story, ActionGroup)
     assert_isbool(is_debug)
 
-    flags = _story_flags_info_converted(story)
-    return ["## Flags\n"] + flags
+    chars = ["## Characters\n", "- Total: {}".format(_count_descriptions(story))]
+    flags = ["## Flags\n"] +  _story_flags_info_converted(story)
+    return chars + flags
 
 
 def _story_title_of(act: TagAction, level: int) -> str:


Test patch:
diff --git a/tests/test_tools.py b/tests/test_tools.py
index 0dbddb0..10f0880 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -486,6 +486,24 @@ class PrivateMethodsTest(unittest.TestCase):
             with self.subTest(v=v, expected=expected):
                 self.assertEqual(tools._story_flags_info_converted(v), expected)
 
+    def test_story_info_data_converted(self):
+        data = [
+                (self.ma.story("test",
+                    self.taro.be(Flag("apple"))),
+                    False,
+                    ["## Characters\n", "- Total: 0",
+                        "## Flags\n", "[apple]:apple"]),
+                (self.ma.story("test",
+                    self.taro.be().d("test apple")),
+                    False,
+                    ["## Characters\n", "- Total: 9",
+                        "## Flags\n"]),
+                ]
+
+        for v, isdbg, expected in data:
+            with self.subTest(v=v, isdbg=isdbg, expected=expected):
+                self.assertEqual(tools._story_info_data_converted(v, isdbg), expected)
+
     def test_story_title_of(self):
         ma = Master('test')