MCPcopy Create free account
hub / github.com/PythonOT/POT / test_BaseEstimator

Function test_BaseEstimator

test/test_utils.py:428–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

426
427
428def test_BaseEstimator():
429 class Class(ot.utils.BaseEstimator):
430 def __init__(self, first="spam", second="eggs"):
431 self.first = first
432 self.second = second
433
434 cl = Class()
435
436 names = cl._get_param_names()
437 assert "first" in names
438 assert "second" in names
439
440 params = cl.get_params()
441 assert "first" in params
442 assert "second" in params
443
444 params["first"] = "spam again"
445 cl.set_params(**params)
446
447 with pytest.raises(ValueError):
448 cl.set_params(bibi=10)
449
450 assert cl.first == "spam again"
451
452
453def test_OTResult():

Callers

nothing calls this directly

Calls 4

ClassClass · 0.85
_get_param_namesMethod · 0.80
get_paramsMethod · 0.80
set_paramsMethod · 0.80

Tested by

no test coverage detected