mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 21:11:14 -05:00
SysDNS: allow changing the 'host' binary in tests, via environment variable SYSDNS_HOST_COMMAND
This commit is contained in:
parent
e70db1ca72
commit
4b9e6d2f7c
@ -1,5 +1,5 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2014-2015, James Lu
|
# Copyright (c) 2014-2016, James Lu <glolol@overdrivenetworks.com>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -27,14 +27,25 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
###
|
###
|
||||||
|
import os
|
||||||
|
|
||||||
from supybot.test import *
|
from supybot.test import *
|
||||||
|
from supybot import conf
|
||||||
|
|
||||||
class SysDNSTestCase(PluginTestCase):
|
class SysDNSTestCase(PluginTestCase):
|
||||||
plugins = ('SysDNS',)
|
plugins = ('SysDNS',)
|
||||||
|
|
||||||
|
# Make the 'host' binary that should be used configurable. This is useful in
|
||||||
|
# Travis-CI for example, where bind9-host (/usr/bin/host) isn't available, but
|
||||||
|
# unbound-host is via /usr/bin/unbound-host.
|
||||||
|
host_cmd = os.environ.get('SYSDNS_HOST_COMMAND', conf.supybot.plugins.SysDNS.command())
|
||||||
|
|
||||||
|
config = {'supybot.plugins.SysDNS.command': host_cmd}
|
||||||
|
|
||||||
|
print('SysDNS: using %r as host binary' % host_cmd)
|
||||||
|
|
||||||
def testBasics(self):
|
def testBasics(self):
|
||||||
self.assertNotError('sysdns dns google.com')
|
self.assertNotError('sysdns dns google.com')
|
||||||
|
self.assertRegexp('sysdns dns localhost', '127\.0\.0\.1')
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user