aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/close.py
blob: 4f50b58efa8d2ef49b6f19e60c71c8a0b8efd08f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Close a bug"""
from libbe import cmdutil
def execute(args):
    """
    >>> from libbe import tests
    >>> import os
    >>> dir = tests.simple_bug_dir()
    >>> os.chdir(dir.dir)
    >>> dir.get_bug("a").status
    'open'
    >>> execute(("a",))
    >>> dir.get_bug("a").status
    'closed'
    """
    assert(len(args) == 1)
    bug = cmdutil.get_bug(args[0])
    bug.status = "closed"
    bug.save()