Beispiel #1
0
    def test_remove_not_existing(self):
        """Test removing if doesn't exist in database."""

        obj = self.session.query(db.Instance).all()
        assert 1 == len(obj)
        assert '1.2.3.4' == obj[0].sop_instance_uid

        db.remove_instance('1.2.3.5', self.session)

        assert self.session.query(db.Instance).all()
Beispiel #2
0
    def test_remove_existing(self):
        """Test removing if exists in database."""

        obj = self.session.query(db.Instance).all()
        assert 1 == len(obj)
        assert '1.2.3.4' == obj[0].sop_instance_uid

        db.remove_instance('1.2.3.4', self.session)

        assert not self.session.query(db.Instance).all()
        assert not self.session.query(db.Patient).all()
        assert not self.session.query(db.Study).all()
        assert not self.session.query(db.Series).all()
        assert not self.session.query(db.Image).all()