Пример #1
0
    def testLogfileNotExists(self):
        """Test start of quit store without logfile."""
        args = quitApp.parseArgs(
            ['-c', self.localConfigFile, '-cm', 'localconfig'])
        quitApp.initialize(args)

        self.assertFalse(os.path.isfile(self.logfile))
Пример #2
0
    def testGitLog(self):
        """Test /git/log API request."""
        args = quitApp.parseArgs(
            ['-c', self.localConfigFile, '-cm', 'localconfig'])
        quitApp.initialize(args)

        response = self.app.get('/git/log')
        self.assertEqual(response.status, '200 OK')
Пример #3
0
    def testStartApp(self):
        """Test start of quit store."""
        args = quitApp.parseArgs(
            ['-c', self.localConfigFile, '-cm', 'localconfig'])
        quitApp.initialize(args)

        query = "SELECT * WHERE {graph ?g {?s ?p ?o .}}"
        response = self.app.post('/sparql', data=dict(query=query))
        self.assertEqual(response.status, '200 OK')
Пример #4
0
    def testGCConfiguration(self):
        """Test Garbage Collection configuration."""
        args = quitApp.parseArgs(['-c', self.localConfigFile, '-gc'])
        quitApp.initialize(args)

        with subprocess.Popen(["git", "config", "gc.auto"],
                              stdout=subprocess.PIPE,
                              cwd=self.local) as getGCAuto:
            stdout, stderr = getGCAuto.communicate()
            response = stdout.decode("UTF-8").strip()

        self.assertNotEqual(response, '')
        self.assertEqual(response, '256')
Пример #5
0
    def testLogfileExists(self):
        """Test start of quit store with logfile."""
        self.assertFalse(os.path.isfile(self.logfile))

        args = quitApp.parseArgs([
            '-c', self.localConfigFile, '-cm', 'localconfig', '-l',
            self.logfile
        ])

        quitApp.initialize(args)

        self.assertTrue(os.path.isfile(self.logfile))
        self.assertNotEqual(stat(self.logfile).st_size, 0)

        infomsg = 'QuitStore successfully running.'
        check = False

        with open(self.logfile) as logFile:
            if infomsg in logFile.read():
                check = True

        self.assertTrue(check)