Exemple #1
0
    def testdelete_content(self):
        TestFileUtils.load("geom/main.cpp")
        cid = BlockCellName("admin/geom/main.cpp")
        content = mother.make_content(cid, CPP)

        self.db.upsert_edition_contents([content])
        self.db.delete_edition_contents([cid])
        with self.assertRaises(KeyError):
            self.db.read_edition_contents()[cid]
Exemple #2
0
    def testdelete_content(self):
        TestFileUtils.load("geom/main.cpp")
        cid = BlockCellName("admin/geom/main.cpp")
        content = mother.make_content(cid, CPP)

        self.db.upsert_edition_contents([content])
        self.db.delete_edition_contents([cid])
        with self.assertRaises(KeyError):
            self.db.read_edition_contents([cid])[cid]
Exemple #3
0
    def testStoreContent(self):
        modified_load = TestFileUtils.load("geom/main.cpp")
        cid = BlockCellName("admin/geom/main.cpp")
        original_content = mother.make_content(cid, CPP)
        original_sha = original_content.load.sha

        self.db.upsert_edition_contents([original_content])
        retrieved1 = self.db.read_edition_contents()[cid]
        self.assertEqual(original_content, retrieved1)
        self.assertEquals(original_sha, retrieved1.sha)

        original_content.set_blob(Blob(modified_load))
        modified_sha = original_content.load.sha

        self.db.upsert_edition_contents([original_content])
        retrieved2 = self.db.read_edition_contents()[cid]
        self.assertEquals(modified_sha, retrieved2.sha)
Exemple #4
0
    def testStoreContent(self):
        modified_load = TestFileUtils.load("geom/main.cpp")
        cid = BlockCellName("admin/geom/main.cpp")
        original_content = mother.make_content(cid, CPP)
        original_sha = original_content.load.sha

        self.db.upsert_edition_contents([original_content])
        retrieved1 = self.db.read_edition_contents([cid])[cid]
        self.assertEqual(original_content, retrieved1)
        self.assertEquals(original_sha, retrieved1.sha)

        original_content.load.binary = modified_load
        modified_sha = original_content.load.sha

        self.db.upsert_edition_contents([original_content])
        retrieved2 = self.db.read_edition_contents([cid])[cid]
        self.assertEquals(modified_sha, retrieved2.sha)
 def test_find_gtest_implementations(self):
     text = testfileutils.load('gtest/src/gtest-death-test.cc')
     parser = DRLCPPParser()
     parser.parse(text)
     self.assertIn(CPPDeclaration('../include/gtest/internal/gtest-port.h'),
                   parser.explicit_declarations)
Exemple #6
0
 def test_find_gtest_implementations(self):
     text = testfileutils.load('gtest/src/gtest-death-test.cc')
     parser = DRLCPPParser()
     parser.parse(text)
     self.assertIn(CPPDeclaration('../include/gtest/internal/gtest-port.h'),
                   parser.explicit_declarations)