Commit aa0060d0 authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed tests.

parent 061fd215
Pipeline #12257 failed with stage
in 4 minutes and 52 seconds
......@@ -28,7 +28,7 @@ from nifty import PowerSpace, RGSpace, Space
from types import NoneType
from test.common import expand
# [harmonic_domain, distribution_strategy,
# [harmonic_partner, distribution_strategy,
# logarithmic, nbin, binbounds, expected]
CONSTRUCTOR_CONFIGS = [
[1, 'not', False, None, None, {'error': ValueError}],
......@@ -53,7 +53,7 @@ CONSTRUCTOR_CONFIGS = [
'shape': (2,),
'dim': 2,
'total_volume': 8.0,
'harmonic_domain': RGSpace((8,), harmonic=True),
'harmonic_partner': RGSpace((8,), harmonic=True),
'log': True,
'nbin': None,
'binbounds': None,
......@@ -94,7 +94,7 @@ def get_weight_configs():
class PowerSpaceInterfaceTest(unittest.TestCase):
@expand([
['harmonic_domain', Space],
['harmonic_partner', Space],
['logarithmic', bool],
['nbin', (int, NoneType)],
['binbounds', (list, NoneType)],
......@@ -112,16 +112,16 @@ class PowerSpaceInterfaceTest(unittest.TestCase):
class PowerSpaceFunctionalityTest(unittest.TestCase):
@expand(CONSTRUCTOR_CONFIGS)
def test_constructor(self, harmonic_domain, distribution_strategy,
def test_constructor(self, harmonic_partner, distribution_strategy,
logarithmic, nbin, binbounds, expected):
if 'error' in expected:
with assert_raises(expected['error']):
PowerSpace(harmonic_domain=harmonic_domain,
PowerSpace(harmonic_partner=harmonic_partner,
distribution_strategy=distribution_strategy,
logarithmic=logarithmic, nbin=nbin,
binbounds=binbounds)
else:
p = PowerSpace(harmonic_domain=harmonic_domain,
p = PowerSpace(harmonic_partner=harmonic_partner,
distribution_strategy=distribution_strategy,
logarithmic=logarithmic, nbin=nbin,
binbounds=binbounds)
......@@ -132,14 +132,14 @@ class PowerSpaceFunctionalityTest(unittest.TestCase):
assert_equal(getattr(p, key), value)
@expand(get_distance_array_configs())
def test_distance_array(self, harmonic_domain, expected):
p = PowerSpace(harmonic_domain=harmonic_domain)
def test_distance_array(self, harmonic_partner, expected):
p = PowerSpace(harmonic_partner=harmonic_partner)
assert_almost_equal(p.get_distance_array('not'), expected)
@expand(get_weight_configs())
def test_weight(self, harmonic_domain, x, power, axes,
def test_weight(self, harmonic_partner, x, power, axes,
inplace, expected):
p = PowerSpace(harmonic_domain=harmonic_domain)
p = PowerSpace(harmonic_partner=harmonic_partner)
res = p.weight(x, power, axes, inplace)
assert_almost_equal(res, expected)
if inplace:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment