#1805 closed defect (fixed)

tahoe cp verbose counts from 0 to n-1 of n

Reported by: ChosenOne Owned by:
Priority: normal Milestone: 1.10.0
Component: code-frontend-cli Version: 1.9.2
Keywords: reviewed Cc:
Launchpad Bug:

Description

When I use "tahoe cp" to copy files, it gives messages like

 examining 0 of 2
 examining 1 of 2

It's a simple off by one.

patch attached.

Attachments (2)

tahoe_cp.py.patch (1.8 KB) - added by ChosenOne at 2012-09-14T12:20:50Z.
suggested patch
test_cli.patch (848 bytes) - added by ChosenOne at 2012-09-14T17:47:14Z.
patch file for test

Download all attachments as: .zip

Change History (10)

Changed at 2012-09-14T12:20:50Z by ChosenOne

suggested patch

comment:1 Changed at 2012-09-14T16:41:56Z by zooko

  • Keywords test-needed added

Thank you for the patch, ChosenOne! This needs a unit test. Here are the extant tests of the tahoe cp command. Someone (possibly you, ChosenOne) needs to make a method of class Cp which copies more than one file, and fails unless the stdout has the right count in it. Note that the do_cli helper function that is already defined in test_cli.py captures stdout by default and passes it as the second argument to the callback.

Changed at 2012-09-14T17:47:14Z by ChosenOne

patch file for test

comment:2 Changed at 2012-09-14T17:49:02Z by ChosenOne

sorry for the confusion: I did not find the button to remove a patch, so now I uploaded a second patch file for test_cli.py. [Now removed --davidsarah]

the most recent one (test_cli.patch​) works and yields a success when running make quicktest TEST=allmydata.test.test_cli.Cp.test_copy_using_filecap :)

Last edited at 2012-09-14T21:10:08Z by davidsarah (previous) (diff)

comment:3 Changed at 2012-09-14T21:07:57Z by davidsarah

  • Keywords review-needed added; test-needed removed
  • Milestone changed from undecided to 1.10.0
  • Owner set to davidsarah
  • Priority changed from minor to normal
  • Status changed from new to assigned

comment:4 Changed at 2012-09-14T21:11:46Z by davidsarah

  • Keywords reviewed added; review-needed removed

The test patch adds extraneous whitespace on a blank line.

Other than that +1, good to apply.

comment:5 Changed at 2012-09-15T14:00:50Z by ChosenOne

Thanks for the review.

comment:6 Changed at 2012-09-28T16:25:39Z by davidsarah

  • Owner davidsarah deleted
  • Status changed from assigned to new

comment:7 Changed at 2012-11-22T01:32:40Z by davidsarah

Fixed in 595d611c9b4b29c8.

comment:8 Changed at 2012-11-22T01:32:52Z by davidsarah

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.