예제 #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()