Added test for multimethod inheritance
This commit is contained in:
parent
f35a91a88a
commit
7bb7b94666
@ -107,3 +107,7 @@ def test_multimethod_with_base_class(mock_packages):
|
||||
|
||||
pkg = spack.repo.get('multimethod@1')
|
||||
assert pkg.base_method() == "base_method"
|
||||
|
||||
def test_multimethod_inheritance(mock_packages):
|
||||
pkg = spack.repo.get('multimethod-inheritor@1.0')
|
||||
assert pkg.no_version_2() == 1
|
||||
|
@ -0,0 +1,13 @@
|
||||
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.pkg.builtin.mock.multimethod import Multimethod
|
||||
|
||||
|
||||
class MultimethodInheritor(Multimethod):
|
||||
"""This package is designed for use with Spack's multimethod test.
|
||||
It has a bunch of test cases for the @when decorator that the
|
||||
test uses.
|
||||
"""
|
@ -31,6 +31,10 @@ class Zlib(Package):
|
||||
|
||||
patch('w_patch.patch', when="@1.2.11%cce")
|
||||
|
||||
@when('%pgi')
|
||||
def patch(self):
|
||||
print "patching"
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
shared = '+shared' in self.spec
|
||||
|
Loading…
Reference in New Issue
Block a user