Beispiel #1
0
def test_browse_dest_only(document, iscouchapp, getcwd):
    '''
    $ couchapp browse {db url}
    '''
    conf = NonCallableMock(name='conf')
    dest = 'http://localhost:5984'
    doc = document()

    ret_code = commands.browse(conf, dest)
    iscouchapp.assert_called_with('/mock_dir/app')
    assert doc.browse.called
Beispiel #2
0
def test_browse_exist(document, iscouchapp):
    '''
    $ couchapp browse {not app dir} {db url}
    '''
    conf = NonCallableMock(name='conf')
    app = '/mock_dir/notapp'
    dest = 'http://localhost:5984'
    doc = document()

    ret_code = commands.browse(conf, app, dest)
    iscouchapp.assert_called_with('/mock_dir/notapp')
    assert not doc.browse.called