def test_main(self, comps, feats): """Functional test""" eeglcf._integrate(10, *feats) res = eeglcf._integrate(10, feats=feats) # All results must have the same shape as comps for res_n in res: assert (res_n.shape == comps.shape)
def test_kwargs(self): """Unexpected keywords""" with pytest.raises(KeyError): eeglcf._integrate(10, np.zeros([10] * 3), error=0) with pytest.raises(KeyError): eeglcf._integrate(10, feats=(np.zeros([10] * 3), ), error=0) with pytest.raises(KeyError): eeglcf._integrate(10)
def ifeats(feats): """Integrated features""" return eeglcf._integrate(10, *feats)
def test_feats(self): """Features must be arrays""" # Specified as non-keyworded arguments with pytest.raises(TypeError): eeglcf._integrate(10, np.zeros([10] * 3), range(5)) with pytest.raises(TypeError): eeglcf._integrate(10, np.zeros([10] * 3), 'error') with pytest.raises(ValueError): eeglcf._integrate(10, np.zeros([10] * 3), np.zeros([10] * 2)) with pytest.raises(ValueError): eeglcf._integrate(10, np.zeros([10] * 3), np.zeros([10] * 4)) # Specified as keyworded a argument with pytest.raises(TypeError): eeglcf._integrate(10, feats=np.zeros([10] * 3)) # Multiple definition of features with pytest.raises(KeyError): eeglcf._integrate(10, np.zeros([10] * 3), feats=[ np.zeros([10] * 3), ])