Exemple #1
0
    def test_expansions_can_be_added(self):
        v = Variant("variant name")
        v.expansion("k0", "v0")
        v.expansions({"k1": "v1", "k2": "v2"})

        obj = v.to_map()
        assert "v0" in obj["expansions"]["k0"]
        assert "v1" in obj["expansions"]["k1"]
        assert "v2" in obj["expansions"]["k2"]
Exemple #2
0
 def test_invalid_expansions(self):
     v = Variant("variant name")
     with pytest.raises(TypeError):
         v.expansions(42)