Ejemplo n.º 1
0
    def test_get_not_found_must_raise(self):
        h1 = Host(0, "n")
        s1 = Storage(1, "n")
        p = Platform([h1, s1])
        with pytest.raises(LookupError) as excinfo:
            p.get(2)

        assert "no resources" in str(excinfo.value)
Ejemplo n.º 2
0
    def test_get_with_storage(self):
        h1 = Host(0, "n")
        s1 = Storage(1, "n")
        p = Platform([h1, s1])

        assert p.get(1) == s1