def test_contains(): """Test basic contains logic.""" bounds = CompositionBounds(components={"spam", "eggs"}) assert bounds.contains(CompositionBounds(components={"spam"})) assert not bounds.contains(CompositionBounds(components={"foo"})) assert not bounds.contains(RealBounds(0.0, 2.0, '')) assert not bounds.contains(None) with pytest.raises(TypeError): bounds.contains({"spam"}) from gemd.entity.value import NominalComposition assert bounds.contains(NominalComposition({"spam": 0.2, "eggs": 0.8})) assert not bounds.contains(NominalComposition({"foo": 1.0}))
def test_contains(): """Test basic contains logic.""" bounds = CompositionBounds(components={"spam", "eggs"}) assert bounds.contains(CompositionBounds(components={"spam"})) assert not bounds.contains(CompositionBounds(components={"foo"})) assert not bounds.contains(RealBounds(0.0, 2.0, '')) assert not bounds.contains(None) with pytest.raises(TypeError): bounds.contains({"spam"})