# Path: nuka/tasks/apt.py
# GPG_HEADER = b'-----BEGIN PGP PUBLIC KEY BLOCK-----'
# def apt_watcher(delay, fd):
#     def watcher(task, process):
#     def __init__(self, name=None, src=None, key=None, update=True, **kwargs):
#     def add_key(self, key):
#     def do(self):
#     def diff(self):
#     def __init__(self, cache=None, **kwargs):
#     def do(self):
#     def __init__(self, update_cache=None, **kwargs):
#     def do(self):
#     def __init__(self, packages, **kwargs):
#     def do(self):
#     def __init__(self, packages=None, debconf=None,
#                  debian_frontend='noninteractive', **kwargs):
#     def do(self):
#     def __init__(self, selections=None, **kwargs):
#     def do(self):
#     def __init__(self, packages=None, debconf=None,
#                  debian_frontend='noninteractive', debian_priority=None,
#                  update_cache=None, install_recommends=False, **kwargs):
#     def get_packages_list(self, packages):
#     def do(self):
#     def diff(self):
# class source(Task):
# class update(Task):
# class list(Task):
# class search(Task):
# class upgrade(Task):
# class debconf_set_selections(Task):
# class install(Task):


from nuka.tasks import apt
import pytest
import os
    elif 'jessie' in host.hostname:
        n = 'jessie'
    else:
        n = 'stretch'
    src = 'deb http://apt.dockerproject.org/repo/ debian-{0} main'.format(n)
    res = await apt.source(
        name='docker',
        key='https://yum.dockerproject.org/gpg',
        src=src,
    )
    assert bool(res)
    src = 'deb https://deb.bearstech.com/debian {0}-bearstech main'.format(n)
    res = await apt.source(
        name='bearstech',
        key='https://deb.bearstech.com/bearstech-archive.gpg',
        src=src,
    )
    assert bool(res)


@pytest.mark.asyncio
async def test_debconf_set_selections_doc(host):
    res = await apt.debconf_set_selections(
        [('adduser', 'adduser/homedir-permission', 'true')]
    )
    assert bool(res)


@pytest.mark.asyncio
async def test_update_doc(host):

# Path: nuka/tasks/apt.py
# GPG_HEADER = b'-----BEGIN PGP PUBLIC KEY BLOCK-----'
# def apt_watcher(delay, fd):
#     def watcher(task, process):
#     def __init__(self, name=None, src=None, key=None, update=True, **kwargs):
#     def add_key(self, key):
#     def do(self):
#     def diff(self):
#     def __init__(self, cache=None, **kwargs):
#     def do(self):
#     def __init__(self, update_cache=None, **kwargs):
#     def do(self):
#     def __init__(self, packages, **kwargs):
#     def do(self):
#     def __init__(self, packages=None, debconf=None,
#                  debian_frontend='noninteractive', **kwargs):
#     def do(self):
#     def __init__(self, selections=None, **kwargs):
#     def do(self):
#     def __init__(self, packages=None, debconf=None,
#                  debian_frontend='noninteractive', debian_priority=None,
#                  update_cache=None, install_recommends=False, **kwargs):
#     def get_packages_list(self, packages):
#     def do(self):
#     def diff(self):
# class source(Task):
# class update(Task):
# class list(Task):
# class search(Task):
# class upgrade(Task):
# class debconf_set_selections(Task):
# class install(Task):


# Path: tests/tasks/test_apt.py
from nuka.tasks import apt
import pytest
import os

    elif 'jessie' in host.hostname:
        n = 'jessie'
    else:
        n = 'stretch'
    src = 'deb http://apt.dockerproject.org/repo/ debian-{0} main'.format(n)
    res = await apt.source(
        name='docker',
        key='https://yum.dockerproject.org/gpg',
        src=src,
    )
    assert bool(res)
    src = 'deb https://deb.bearstech.com/debian {0}-bearstech main'.format(n)
    res = await apt.source(
        name='bearstech',
        key='https://deb.bearstech.com/bearstech-archive.gpg',
        src=src,
    )
    assert bool(res)


@pytest.mark.asyncio
async def test_debconf_set_selections_doc(host):
    res = await apt.debconf_set_selections(
        [('adduser', 'adduser/homedir-permission', 'true')]
    )
    assert bool(res)


@pytest.mark.asyncio
async def test_update_doc(host):

    res = await apt.update(cache=3600)