mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-04 16:44:11 +01:00
test_plugin_create: skip if supybot-plugin-create is not installed
This is often the case when tests are run automatically as part of a package build process (e.g. in Debian). Reported by @unit193.
This commit is contained in:
parent
11d4015f71
commit
6f9deecbcf
@ -36,6 +36,11 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import compileall
|
import compileall
|
||||||
|
|
||||||
|
try:
|
||||||
|
from shutil import which
|
||||||
|
except ImportError: # Python < 3.3
|
||||||
|
from distutils.spawn import find_executable as which
|
||||||
|
|
||||||
TEST_PLUGIN_NAME = "TestPlugin"
|
TEST_PLUGIN_NAME = "TestPlugin"
|
||||||
|
|
||||||
class PluginCreateTestCase(SupyTestCase):
|
class PluginCreateTestCase(SupyTestCase):
|
||||||
@ -64,6 +69,12 @@ Dummy test plugin
|
|||||||
self._communicate(proc, cmdinput)
|
self._communicate(proc, cmdinput)
|
||||||
|
|
||||||
def testPluginCreate(self):
|
def testPluginCreate(self):
|
||||||
|
if not which('supybot-plugin-create'):
|
||||||
|
# When tests are run automatically as part of a build process (e.g. in Debian),
|
||||||
|
# don't assume that the bot is installed yet.
|
||||||
|
print('Skipping supybot-plugin-create test because Limnoria has not been installed yet')
|
||||||
|
return
|
||||||
|
|
||||||
tmpdir = conf.supybot.directories.data.tmp()
|
tmpdir = conf.supybot.directories.data.tmp()
|
||||||
curdir = os.getcwd()
|
curdir = os.getcwd()
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user