[MERGE] enhanced mv command

Martin Pool mbp at canonical.com
Mon Jan 15 07:45:10 GMT 2007


On  9 Jan 2007, Marius Kruger <amanic at gmail.com> wrote:
> >+
> >+    def test_mv_already_moved_file(self):
> >+        """a is in repository, b does not exist. User does
> >+        mv a b; bzr mv a b"""
> >
> >^^^ Docstrings should have a one-line summary, then an empty line, then
> >a longer description.
> >
> I can't make up my mind how these doc strings should look
> (I'm going around in circles changing it),
> It is quite difficult to describe these tests in one line without
> almost exactly copying the method name.
> Please tel me which one you would prefer (or give a better suggestion).
> 
>    def test_mv_already_moved_file(self):
>        """Test bzr mv existing_file to new_file.
> 
>        a is in the working tree, b does not exist.
>        User does mv a b; bzr mv a b
> 
>        """
> 
>    def test_mv_already_moved_file(self):
>        """Test bzr mv [existing file] [new file].
> 
>        a is in the working tree, b does not exist.
>        User does mv a b; bzr mv a b
> 
>        """
> 
>    def test_mv_already_moved_file_into_unversioned_subdir(self):
>        """Test bzr mv [already moved file] into [unversioned subdirectory].
> 
>        a is in the working tree, sub1/ is not.
>        User does mv a sub1/a; bzr mv a sub1/a
> 
>        """

Like Aaron I prefer the first.  Strictly speaking there should not be a
blank line before the closing quote either.

Also if the method name is sufficient by itself then it really is fine
for a test not to have a docstring, in my opinion.  For things that are
meant to be in the public apc it's more important.

-- 
Martin



More information about the bazaar mailing list