<commit_before># -*- coding: utf-8 -*-
from test.test_base import TestBase

from ambry.mprlib import PostgreSQLBackend
from ambry_sources.med.postgresql import POSTGRES_PARTITION_SCHEMA_NAME


class SQLiteInspector(object):

    @staticmethod
    def assert_table(warehouse, partition):
        cursor = warehouse._backend._connection.cursor()
        cursor.execute('select name from sqlite_master;')
        result = cursor.fetchall()
        assert partition.vid == result[0][0]


class PostgreSQLInspector(object):

    @staticmethod
    def assert_table(warehouse, partition):
        relation = '{}.{}'.format(POSTGRES_PARTITION_SCHEMA_NAME, partition.vid)
        assert PostgreSQLBackend._relation_exists(
            warehouse._backend._connection,
            relation)


class Test(TestBase):

    def setUp(self):
        super(Test, self).setUp()<commit_msg>Broken tests fixed. #189.<commit_after># -*- coding: utf-8 -*-
from test.test_base import TestBase

from ambry.mprlib.backends.postgresql import PostgreSQLBackend
from ambry_sources.med.postgresql import POSTGRES_PARTITION_SCHEMA_NAME


class SQLiteInspector(object):

    @staticmethod
    def assert_table(warehouse, partition):
        cursor = warehouse._backend._connection.cursor()
        cursor.execute('select name from sqlite_master;')
        result = cursor.fetchall()
        assert partition.vid == result[0][0]


class PostgreSQLInspector(object):

    @staticmethod
    def assert_table(warehouse, partition):
        relation = '{}.{}'.format(POSTGRES_PARTITION_SCHEMA_NAME, partition.vid)
        assert PostgreSQLBackend._relation_exists(
            warehouse._backend._connection,
            relation)


class Test(TestBase):

    def setUp(self):
        super(Test, self).setUp()
{'fraction_non_alphanumeric': 0.09977452085682074, 'fraction_numerical': 0.005073280721533258, 'mean_word_length': 3.6223958333333335, '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': '1666484', 'n_tokens_mistral': 524, 'n_tokens_neox': 511, 'n_words': 104}