<commit_before>import unittest
from provdbconnector.databases import Neo4jConnector
from provdbconnector.databases.baseconnector import InvalidOptionsException,AuthException
from tests.databases.test_baseconnector import ConnectorTestTemplate

test_user_name = "neo4j"
test_user_pass = "<PASSWORD>"
test_host = "192.168.99.100:7687"

class Neo4jConnectorTests(ConnectorTestTemplate):

    def setUp(self):
        self.instance = Neo4jConnector()
        authInfo = dict()
        authInfo.update({"user_name": test_user_name})
        authInfo.update({"user_password":<PASSWORD>})
        authInfo.update({"host": test_host})

        self.instance.connect(authInfo)

    def test_connect(self):
        authInfo = dict()
        authInfo.update({"user_name": "neo4j"})
        authInfo.update({"user_password": "<PASSWORD>"})
        authInfo.update({"host": test_host})
        self.instance.connect(authInfo)

    def test_connect_fails(self):
        authInfo = dict()
        authInfo.update({"user_name": "neo4j"})
        authInfo.update({"user_password": "<PASSWORD>"})
        authInfo.update({"host": test_host})
        self.instance.connect(authInfo)
        with self.assertRaises(AuthException):
            self.instance.connect(authInfo)

    def test_connect_invalid_options(self):
        authInfo = dict()
        authInfo.update({"xxxx": "<PASSWORD>"})
        authInfo.update({"xx": "<PASSWORD>"})
        authInfo.update({"xx": test_host})

        with self.assertRaises(InvalidOptionsException):
            self.instance.connect(authInfo)

    def test_create_document_id_increment(self):
        first= self.instance.create_document()

        first= int(first)

        second = self.instance.create_document()
        second = int(second)

        self.assertEqual(first+1,second)

    def tearDown(self):
        session = self.instance._create_session()
        #session.run("MATCH (x) DETACH DELETE x")
        del self.instance<commit_msg>- uncomment the delete command<commit_after>import unittest
from provdbconnector.databases import Neo4jConnector
from provdbconnector.databases.baseconnector import InvalidOptionsException,AuthException
from tests.databases.test_baseconnector import ConnectorTestTemplate

test_user_name = "neo4j"
test_user_pass = "<PASSWORD>"
test_host = "192.168.99.100:7687"

class Neo4jConnectorTests(ConnectorTestTemplate):

    def setUp(self):
        self.instance = Neo4jConnector()
        authInfo = dict()
        authInfo.update({"user_name": test_user_name})
        authInfo.update({"user_password":<PASSWORD>})
        authInfo.update({"host": test_host})

        self.instance.connect(authInfo)

    def test_connect(self):
        authInfo = dict()
        authInfo.update({"user_name": "neo4j"})
        authInfo.update({"user_password": "<PASSWORD>"})
        authInfo.update({"host": test_host})
        self.instance.connect(authInfo)

    def test_connect_fails(self):
        authInfo = dict()
        authInfo.update({"user_name": "neo4j"})
        authInfo.update({"user_password": "<PASSWORD>"})
        authInfo.update({"host": test_host})
        self.instance.connect(authInfo)
        with self.assertRaises(AuthException):
            self.instance.connect(authInfo)

    def test_connect_invalid_options(self):
        authInfo = dict()
        authInfo.update({"xxxx": "neo4j"})
        authInfo.update({"xx": "<PASSWORD>"})
        authInfo.update({"xx": test_host})

        with self.assertRaises(InvalidOptionsException):
            self.instance.connect(authInfo)

    def test_create_document_id_increment(self):
        first= self.instance.create_document()

        first= int(first)

        second = self.instance.create_document()
        second = int(second)

        self.assertEqual(first+1,second)

    def tearDown(self):
        session = self.instance._create_session()
        session.run("MATCH (x) DETACH DELETE x")
        del self.instance
{'fraction_non_alphanumeric': 0.12187104930467763, 'fraction_numerical': 0.011378002528445006, 'mean_word_length': 3.3955555555555557, 'pattern_counts': {'":': 24, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5386223', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1157, 'n_words': 191}