def test_02_modify_statement(self):
     n = datetime.now()
     ods = [
         ("http://od1/", n, "http://package/", "sword", "obo"),
         ("http://od2/", n, "http://package/", "bob", None)
     ]
     s = Statement(aggregation_uri="http://aggregation/", rem_uri="http://rem/",
                     original_deposits=ods,
                     aggregates=["http://od1/", "http://od2/", "http://agg1/", "http://agg2/"],
                     states=[("http://state/", "everything is groovy")])
     
     s.set_state("http://new/state/", "still good, though")
     
     assert len(s.states) == 1
     state_uri, state_description = s.states[0]
     assert state_uri == "http://new/state/"
     assert state_description == "still good, though"
     
     s.add_state("http://another/state", "also, this")
     assert len(s.states) == 2
Exemplo n.º 2
0
    def test_02_modify_statement(self):
        n = datetime.now()
        ods = [("http://od1/", n, "http://package/", "sword", "obo"),
               ("http://od2/", n, "http://package/", "bob", None)]
        s = Statement(aggregation_uri="http://aggregation/",
                      rem_uri="http://rem/",
                      original_deposits=ods,
                      aggregates=[
                          "http://od1/", "http://od2/", "http://agg1/",
                          "http://agg2/"
                      ],
                      states=[("http://state/", "everything is groovy")])

        s.set_state("http://new/state/", "still good, though")

        assert len(s.states) == 1
        state_uri, state_description = s.states[0]
        assert state_uri == "http://new/state/"
        assert state_description == "still good, though"

        s.add_state("http://another/state", "also, this")
        assert len(s.states) == 2