<commit_before>##################################################
#
#   Author          : josuebrunel
#   Filename        : tests.py
#   Description     :
#   Creation Date   : 03-04-2015
#   Last Modified   : Sun 05 Apr 2015 12:56:53 PM CEST
#
##################################################

import os, logging
import unittest
import subprocess

logging.basicConfig(level=logging.DEBUG,format="[%(asctime)s %(levelname)s] [%(funcName)s] %(message)s \n")

class TestYqlQuery(unittest.TestCase):

    def execute(self, args):
        query="'select * from geo.countries where name=\"Congo\"'"
        cmd="python lokingyql-cli.py execute {0} {1}".format(args, query)
        logging.debug(cmd)
        exit_code = subprocess.call("{0}".format(cmd), shell=True)
        return exit_code

    def testJsonCompact(self,):
        self.assertEquals(self.execute('--format json --jsonCompact'),0)

    def testDiagnostics(self,):
        self.assertEquals(self.execute('--diagnostics'),0)

    def testDebug(self,):
        self.assertEquals(self.execute('--debug'),0)

    def testAllOptions(self,):
        self.assertEquals(self.execute('--format json --debug --diagnostics --jsonCompact'),0)
<commit_msg>improving output<commit_after>##################################################
#
#   Author          : josuebrunel
#   Filename        : tests.py
#   Description     :
#   Creation Date   : 03-04-2015
#   Last Modified   : Sun 05 Apr 2015 01:00:07 PM CEST
#
##################################################

import os, logging
import unittest
import subprocess

logging.basicConfig(level=logging.DEBUG,format="[%(asctime)s %(levelname)s] [%(funcName)s] %(message)s \n")

class TestYqlQuery(unittest.TestCase):

    def execute(self, args):
        query="'select * from geo.countries where name=\"Congo\"'"
        cmd="python lokingyql-cli.py execute {0} {1}".format(args, query)
        logging.debug(cmd)
        print("\n")
        exit_code = subprocess.call("{0}".format(cmd), shell=True)
        return exit_code

    def testJsonCompact(self,):
        self.assertEquals(self.execute('--format json --jsonCompact'),0)

    def testDiagnostics(self,):
        self.assertEquals(self.execute('--diagnostics'),0)

    def testDebug(self,):
        self.assertEquals(self.execute('--debug'),0)

    def testAllOptions(self,):
        self.assertEquals(self.execute('--format json --debug --diagnostics --jsonCompact'),0)

{'fraction_non_alphanumeric': 0.2188911704312115, 'fraction_numerical': 0.02217659137577002, 'mean_word_length': 3.5962264150943395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1100046', 'n_tokens_mistral': 780, 'n_tokens_neox': 724, 'n_words': 142}