def _popcon(self, irc, msg, args, package): try: msg = popcon(package) if msg: irc.reply(colourise(msg.for_irc()), prefixNick=False) except Exception, e: irc.reply("Error: unable to obtain popcon data for %s" % package)
def _popcon(self, irc, msg, args, package): """Get popcon data.""" try: msg = popcon(package, self.requests_session) if msg: irc.reply(colourise(msg.for_irc()), prefixNick=False) except Exception as e: irc.reply("Error: unable to obtain popcon data for %s" % package)
def _test(self, package='haskell-devscripts'): fixture = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures', 'popcon', package) with io.open(fixture, encoding='utf-8') as f: data = f.read() self.mocker.register_uri('GET', 'https://qa.debian.org/popcon.php', text=data) return popcon(package, self.session)
def _test(self, package="haskell-devscripts"): fixture = os.path.join(os.path.dirname(os.path.abspath(__file__)), "fixtures", "popcon", package) with io.open(fixture, encoding="utf-8") as f: data = f.read() self.mocker.register_uri("GET", "https://qa.debian.org/popcon.php", text=data) return popcon(package, self.session)
def _test(self, package='haskell-devscripts'): return popcon(package, open(os.path.join(os.path.dirname(os.path.abspath(__file__)), \ 'fixtures', 'popcon', package)))