File: test_cmd_dumpdb.py

package info (click to toggle)
doit 0.25.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,404 kB
  • ctags: 1,504
  • sloc: python: 11,084; makefile: 111; ansic: 14
file content (18 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest

from doit.cmd_dumpdb import DumpDB

class TestCmdDumpDB(object):

    def testDefault(self, capsys, depfile):
        if depfile.whichdb in ('dbm', 'dbm.ndbm'): # pragma: no cover
            pytest.skip('%s not supported for this operation' % depfile.whichdb)
        # cmd_main(["help", "task"])
        depfile._set('tid', 'my_dep', 'xxx')
        depfile.close()
        cmd_dump = DumpDB()
        cmd_dump.execute({'dep_file': depfile.name}, [])
        out, err = capsys.readouterr()
        assert 'tid' in out
        assert 'my_dep' in out
        assert 'xxx' in out