Пример #1
0
class SyncTestCase(unittest.TestCase):
    def setUp(self):
        """all tests should return self.done"""
        logging.basicConfig(level=logging.INFO)

        try:
            os.remove("new.nt")
        except OSError:
            pass

        self.graph = Graph2(shared.localGraph(), initNs={'exp': EXP})
        self.sync = SyncImport(self.graph, pollSeconds=.5)
        self.stmt1 = (EXP['dp'], EXP['name'], Literal("Drew"))

        self.done = defer.Deferred()

    def tearDown(self):
        self.sync.stop()

    def checkAndComplete(self, checkFunc):
        """decorator to add some completion code after checkFunc"""
        def go():
            try:
                checkFunc()
                self.done.callback(None)
            except KeyboardInterrupt:
                raise
            except Exception, e:
                traceback.print_exc()
                self.done.errback(e)
                raise e

        return go
Пример #2
0
class SyncTestCase(unittest.TestCase):
    def setUp(self):
        """all tests should return self.done"""
        logging.basicConfig(level=logging.INFO)

        try:
            os.remove("new.nt")
        except OSError:
            pass
        
        self.graph = Graph2(shared.localGraph(), initNs={'exp' : EXP})
        self.sync = SyncImport(self.graph, pollSeconds=.5)
        self.stmt1 = (EXP['dp'], EXP['name'], Literal("Drew"))

        self.done = defer.Deferred()

    def tearDown(self):
        self.sync.stop()

    def checkAndComplete(self, checkFunc):
        """decorator to add some completion code after checkFunc"""
        def go():
            try:
                checkFunc()
                self.done.callback(None)
            except KeyboardInterrupt: raise
            except Exception, e:
                traceback.print_exc()
                self.done.errback(e)
                raise e
        return go
Пример #3
0
    def setUp(self):
        """all tests should return self.done"""
        logging.basicConfig(level=logging.INFO)

        try:
            os.remove("new.nt")
        except OSError:
            pass

        self.graph = Graph2(shared.localGraph(), initNs={'exp': EXP})
        self.sync = SyncImport(self.graph, pollSeconds=.5)
        self.stmt1 = (EXP['dp'], EXP['name'], Literal("Drew"))

        self.done = defer.Deferred()
Пример #4
0
    def setUp(self):
        """all tests should return self.done"""
        logging.basicConfig(level=logging.INFO)

        try:
            os.remove("new.nt")
        except OSError:
            pass
        
        self.graph = Graph2(shared.localGraph(), initNs={'exp' : EXP})
        self.sync = SyncImport(self.graph, pollSeconds=.5)
        self.stmt1 = (EXP['dp'], EXP['name'], Literal("Drew"))

        self.done = defer.Deferred()