[Future Task]: Add better tests

Bug #189572 reported by Markus Korn on 2008-02-06
14
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Medium
Markus Korn

Bug Description

py-lp-bugs definitely needs better and more complete testing code.
Such tests should be able to
    * point us to changes in launchpad (representation of data etc.)
    * provide testcases to test changes in py-lp-bugs itself

Steps to fix this bug:
    1.) work on the Error messages in py-lp-bugs (Bug 188307)
    2.) rework/ add testcases, I suggest using the unittest framework

Markus

Markus Korn (thekorn) on 2008-02-06
Changed in python-launchpad-bugs:
importance: Undecided → Medium
Markus Korn (thekorn) wrote :

I started to work on this bug over the weekend, let me give you a short overview of the current state:

* I'm using python's unittest-module as a testing framework
* I added a cmdl. tool to run/manage the testcases, to get a list of all available testcases run:
$ python testing/run_tests.py -l
** this return something like:
testmodul1
    .testclass1
        .testcase1
        .testcase2
    .testclass2
        .testcase1
testmodul2
    .testclass1
        .testcase1

* to run all testcases run:
$ python testing/run_tests.py -a

* if you want to test py-lp-bugs against python2.4 run:
$ python2.4 testing/run_tests.py -a

* if you want to run only a subset of the testcases, you can use the '-s' option:
$ python testing/run_tests.py -s testmodul1 testmodul2.testclass1 testmodul.testclass2.testcase1
** the number of arguments given to '-s' is arbitrary
** the arguments are path-like strings; to get an summary of all available pathes use the '-l' option described above

* you can also ignore testcases with the '-i' option:
$ python testing/run_tests.py -a -i testmodul1.testclass2.testcase10 testmodule2
** this will ignore the testcase testmodul1.testclass2.testcase10 and all testcases in testmodul2
** there is also some basic RegEx support

* some testcases needs information like the path to a cookiefile or password/email of your launchpad.net account, to run these testcases you need to create "~/.python-launchpad-bugs/test.cfg" with the following content:
[config]
password = mypassword
email = myemail
cookiefile = path-to-cookie-file

The next step will be to create more testcases.

Markus

Changed in python-launchpad-bugs:
assignee: nobody → thekorn
status: New → In Progress
Markus Korn (thekorn) on 2008-04-09
Changed in python-launchpad-bugs:
milestone: none → intrepid
Markus Korn (thekorn) wrote :

the solution in the attached branch has been merged into the intrepid.merge branch

Brian Murray (brian-murray) wrote :

I think we have 2 configuration files now, one for the useragent in ~/.python-launchpad-bugs.conf and one for the tests in ~/.python-launchpad-bugs/test.cfg. Could these be consolidated somehow?

Markus Korn (thekorn) wrote :

there will only be one configfile (~/.python-launchpad-bugs.conf) when a fix for bug 245552 will be implemented.

Markus Korn (thekorn) wrote :

------------------------------------------------------------
revno: 107
committer: Markus Korn <email address hidden>
branch nick: python-launchpad-bugs
timestamp: Wed 2008-07-02 22:34:33 +0200
message:
  * Improved LPBugList and LPBugPage:
    This two classes have now a cleaner structure, filtering of bug lists
    with python-launchpad-bugs is now a lot easier. With
    LPBugList.set_progress_hook() it is now possible to visualize the
    process of fetching bug lists.
  * launchpadbugs/{tasksbase,html_bug.py,text_bug.py}: if a task is a
    bugwatch then task.remote returns the remote-url, otherwise it returns
    'None'
  * Improved error handling in python-launchpad-bugs and added
    infrastructure for unittests. This also contains some basic testcases in
    tests/ (LP: #189572)
  * Added ability to parse bugtracker overviews (LP: #203312)
  * It is now possible to filter bug lists based on milestones. This also
    implements a helper function to list all active milestones of a project
    in launchpad (LP: #200457)
  * Added function to filter buglists based on Bug.date_reported
    (LP: #185357)
  * added 'move-duplicates' written by Kjell Braden and 'README' to
    examples/ (LP: #208148)
  * launchpadbugs/attachmentsbase.py: LPAttachment.download() now also
    accepts an optional argument to specify the location where to download
    the attachment (LP: #242317)
  * Added method to let the user choose which version/server of launchpad to
    use, so it is possible to explicit use bugs.launchpad.net or
    bugs.edge.launchpad.net (LP: #188298)
  * launchpadbugs/html_bug.py: InfoTable: fixed parsing of milestones in
    read-only mode (LP: #243057)
  * Added functionality for adding new tasks to bug reports.
    With this implementation so far you are able to add 'project' and
    'distro' tasks, but unable to create bugwatches and change task
    attributes before committing the changes. (LP: #193853)
  * launchpadbugs/html_bug.py: Stephan Hermann fixed html connector to work
    with the newest launchpad rollout (LP: #243193, #244452)
    .
    Unfortunately this update breaks compatibilty. Please update your code
    to make use of the python-launchpad-bugs 0.3 API. It's worth it.
    ------------------------------------------------------------

Changed in python-launchpad-bugs:
status: In Progress → Fix Committed
Markus Korn (thekorn) wrote :

Fix released in py-lp-bugs 0.3

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers