Exemplo n.º 1
0
 def test_get_document(self):
     scope = Scope(database=self._database)
     for document_id in range(1, 9):
         document = scope.get_document(document_id)
         self.assertEqual(document.id, document_id)
         self.assertEqual(document.name,
                          sample_documents[document_id]['name'])
         self.assertEqual(document.type,
                          sample_documents[document_id]['type'])
         self.assertEqual(document.path,
                          sample_documents[document_id]['path'])
Exemplo n.º 2
0
 def test_get_invalid_document(self):
     scope = Scope(database=self._database)
     with self.assertRaises(ValueError):
         _ = scope.get_document(0)
     with self.assertRaises(ValueError):
         _ = scope.get_document(9)