示例#1
0
def test_get_bugs_list():
    """Test getting buglist"""

    obj = launchpad()

    assert (obj.get_bugs_list("lp: #1234") == ['1234'])
    assert (obj.get_bugs_list("#1234") == [])
示例#2
0
def test_get_package_name():
    """Test getting package name"""

    obj = launchpad()

    assert (obj.get_package_name('rNMTRAYPACKAGING') == 'nm-tray')
    assert (obj.get_package_name('rNMTRKAGING') is None)
示例#3
0
def test_get_package_name():
    """Test get package name"""

    obj = launchpad()

    assert (obj.get_package_name('rART') == 'lubuntu-artwork')
    assert (obj.get_package_name('rT') is None)
示例#4
0
def test_init():
    """Test initialising LPConnector"""

    obj = launchpad()

    assert (obj.application == "lugito")
    assert (obj.staging == "production")
    assert (obj.version == "devel")
    assert (obj.supported_vers == ["Cosmic", "Bionic", "Xenial", "Trusty"])
    assert (obj.package_names == {
        'rDEFAULTSETTINGS': 'lubuntu-default-settings',
        'rART': 'lubuntu-artwork',
        'rCALASETTINGS': 'calamares-settings-ubuntu',
        'rQTERMINALPACKAGING': 'qterminal',
        'rLXQTCONFIGPACKAGING': 'lxqt-config',
        'rNMTRAYPACKAGING': 'nm-tray',
    })
示例#5
0
def test_init():
    """Test initialising LPConnector"""

    obj = launchpad()

    assert (obj.application == "lugito")
    assert (obj.staging == "production")
    assert (obj.version == "devel")
    assert (obj.supported_vers == ["Cosmic", "Bionic", "Xenial", "Trusty"])

    assert(obj.package_names['rdefaultsettings'] ==\
        'lubuntu-default-settings')
    assert(obj.package_names['rart'] ==\
        'lubuntu-artwork')
    assert(obj.package_names['rcalasettings'] ==\
        'calamares-settings-ubuntu')
    assert(obj.package_names['rqterminalpackaging'] ==\
        'qterminal')
    assert(obj.package_names['rlxqtconfigpackaging'] ==\
        'lxqt-config')
    assert(obj.package_names['rnmtraypackaging'] ==\
        'nm-tray')
示例#6
0
import logging
import threading
from flask import Flask, request
from lugito import Lugito
from lugito.connectors import irc, launchpad

# Constants
GLOBAL_LOG_LEVEL = logging.DEBUG

# Instantiate Lugito and connectors
lugito = Lugito(GLOBAL_LOG_LEVEL)
WEBSITE = lugito.host.replace('/api/', '')

# Connectors
irc_con = irc()
launchpad_con = launchpad()

# Logging
logger = logging.getLogger('lugito.webhooks')

# Add log level
ch = logging.StreamHandler()

formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)

logger.addHandler(ch)
logger.setLevel(GLOBAL_LOG_LEVEL)

# Flask