Repository: ddionrails/ddionrails

Issue:
Remove "Magic at work!"




Discussion:

Resolving patch:
diff --git a/ddionrails/workspace/scripts/soep_r.py b/ddionrails/workspace/scripts/soep_r.py
--- a/ddionrails/workspace/scripts/soep_r.py
+++ b/ddionrails/workspace/scripts/soep_r.py
@@ -145,7 +145,7 @@ def _render_done() -> str:
         return (
             "\n"
             "### DONE ###\n\n"
-            'attr(master, "label") <- "paneldata.org: Magic at work!"\n'
+            'attr(master, "label") <- "paneldata.org"\n'
             "str(master)\n"
             'save(master, file=file.path(path_out, "master.RData"))'
         )
diff --git a/ddionrails/workspace/scripts/soep_spss.py b/ddionrails/workspace/scripts/soep_spss.py
--- a/ddionrails/workspace/scripts/soep_spss.py
+++ b/ddionrails/workspace/scripts/soep_spss.py
@@ -147,11 +147,13 @@ def _render_merge(self) -> str:
     @staticmethod
     def _render_done() -> str:
         """ Render a "done" section of the script file """
-        script = "\n* ### DONE ### *.\n"
-        script += "\ndataset close all."
-        script += "\ndataset name new."
-        script += "\ndataset activate new."
-        script += '\nfile label "paneldata.org: Magic at work!".'
-        script += "\nsave outfile = !pathout+'new.sav'."
-        script += "\ndesc all."
-        return script
+        return (
+            "\n"
+            "* ### DONE ### *.\n\n"
+            "dataset close all.\n"
+            "dataset name new.\n"
+            "dataset activate new.\n"
+            'file label "paneldata.org".\n'
+            "save outfile = !pathout+'new.sav'.\n"
+            "desc all."
+        )
diff --git a/ddionrails/workspace/scripts/soep_stata.py b/ddionrails/workspace/scripts/soep_stata.py
--- a/ddionrails/workspace/scripts/soep_stata.py
+++ b/ddionrails/workspace/scripts/soep_stata.py
@@ -267,7 +267,7 @@ def _render_done() -> str:
         return (
             "\n\n"
             "* * * DONE * * *\n\n"
-            'label data "paneldata.org: Magic at work!"\n'
+            'label data "paneldata.org"\n'
             'save "${MY_FILE_OUT}", replace\n'
             "desc\n\n"
             "log close"


Test patch:
diff --git a/tests/workspace/test_scripts.py b/tests/workspace/test_scripts.py
--- a/tests/workspace/test_scripts.py
+++ b/tests/workspace/test_scripts.py
@@ -119,7 +119,7 @@ def test_render_done(self, soepstata):
         expected = (
             "\n\n"
             "* * * DONE * * *\n\n"
-            'label data "paneldata.org: Magic at work!"\n'
+            'label data "paneldata.org"\n'
             'save "${MY_FILE_OUT}", replace\n'
             "desc\n\n"
             "log close"
@@ -149,6 +149,20 @@ def test_render_gender_method_with_both(self, soepspss):
         assert SPSS_R_HEADING_GENDER in result
         assert command in result
 
+    def test_render_done(self, soepspss):
+        result = soepspss._render_done()  # pylint: disable=protected-access
+        expected = (
+            "\n"
+            "* ### DONE ### *.\n\n"
+            "dataset close all.\n"
+            "dataset name new.\n"
+            "dataset activate new.\n"
+            'file label "paneldata.org".\n'
+            "save outfile = !pathout+'new.sav'.\n"
+            "desc all."
+        )
+        assert expected == result
+
 
 class TestSoepR:
     def test_render_gender_method_with_male(self, soepr):
@@ -177,7 +191,7 @@ def test_render_done(self, soepr):
         expected = (
             "\n"
             "### DONE ###\n\n"
-            'attr(master, "label") <- "paneldata.org: Magic at work!"\n'
+            'attr(master, "label") <- "paneldata.org"\n'
             "str(master)\n"
             'save(master, file=file.path(path_out, "master.RData"))'
         )