def test03_delete(self): """Test deletion of resource.""" s = Store('http://ex.org/') uri = s.add(LDPR(content='def')) self.assertEqual(s[uri].content, 'def') s.delete(uri) self.assertRaises(KeyDeleted, s.__getitem__, uri)
def test04_getitem(self): """Test getitem.""" s = Store('http://ex.org/') self.assertRaises(KeyError, s.__getitem__, 'http://ex.org/') self.assertRaises(KeyError, s.__getitem__, 'http://ex.org/a-z') uri = s.add(LDPR(), uri='http://ex.org/bbb') self.assertTrue(s['http://ex.org/bbb']) s.delete('http://ex.org/bbb') self.assertRaises(KeyDeleted, s.__getitem__, 'http://ex.org/bbb')