コード例 #1
0
 def test_get_item(self):
     query_continue = self.ricketts['query-continue']
     test_pelican = PelicanJson(self.ricketts)
     query_pelican = PelicanJson(query_continue)
     self.assertEqual(test_pelican.get('query-continue'),
                      query_pelican)
     self.assertEqual(test_pelican.get('NO-KEY'),
                      None)
コード例 #2
0
 def test_delete_item(self):
     test_pelican = PelicanJson(self.pelecanus_occidentalis)
     test_pelican['query'] = ['some', 'new' 'vals']
     self.assertEqual(test_pelican['query'], ['some', 'new' 'vals'])
     del test_pelican['query']
     self.assertEqual(test_pelican.get('query'),
                      None)
     with self.assertRaises(KeyError):
         del test_pelican['none']