<commit_before># -*- coding: utf-8 -*-

"""Unit tests for cartoframes.examples"""
import unittest

import pandas as pd
from cartoframes.examples import Examples


class TestExamples(unittest.TestCase):
    """Tests examples class"""
    def setUp(self):
        self.examples = Examples()

    def test_tables(self):
        """examples.tables"""
        tables = self.examples.tables()
        self.assertTrue(tables)

    def test_disabled_context_functions(self):
        """examples.Example.x_methods that are disabled"""
        with self.assertRaises(RuntimeError):
            self.examples.data()
        with self.assertRaises(RuntimeError):
            self.examples.write(None, table_name='t')
        with self.assertRaises(RuntimeError):
            self.examples.data_boundaries()
        with self.assertRaises(RuntimeError):
            self.examples.data_discovery(None)
        with self.assertRaises(RuntimeError):
            self.examples.data_augment(None, None)

    def test_read_taxi(self):
        """examples.read_taxi"""
        from cartoframes.examples import read_taxi
        # method test
        taxi = self.examples.read_taxi()
        self.assertIsInstance(taxi, pd.DataFrame)
        self.assertGreater(taxi.shape[0], 0)

        # function test
        taxi = read_taxi()
        self.assertIsInstance(taxi, pd.DataFrame)
        self.assertGreater(taxi.shape[0], 0)

    def test_read_brooklyn_poverty(self):
        """examples.read_brooklyn_poverty"""
        from cartoframes.examples import read_brooklyn_poverty
        # method test
        bp = self.examples.read_brooklyn_poverty()
        self.assertIsInstance(bp, pd.DataFrame)
        self.assertGreaterEqual(bp.shape[0], 0)
<commit_msg>updates test for correct data signature<commit_after># -*- coding: utf-8 -*-

"""Unit tests for cartoframes.examples"""
import unittest

import pandas as pd
from cartoframes.examples import Examples


class TestExamples(unittest.TestCase):
    """Tests examples class"""
    def setUp(self):
        self.examples = Examples()

    def test_tables(self):
        """examples.tables"""
        tables = self.examples.tables()
        self.assertTrue(tables)

    def test_disabled_context_functions(self):
        """examples.Example.x_methods that are disabled"""
        with self.assertRaises(RuntimeError):
            self.examples.data(None, None)
        with self.assertRaises(RuntimeError):
            self.examples.write(None, table_name='t')
        with self.assertRaises(RuntimeError):
            self.examples.data_boundaries()
        with self.assertRaises(RuntimeError):
            self.examples.data_discovery(None)
        with self.assertRaises(RuntimeError):
            self.examples.data_augment(None, None)

    def test_read_taxi(self):
        """examples.read_taxi"""
        from cartoframes.examples import read_taxi
        # method test
        taxi = self.examples.read_taxi()
        self.assertIsInstance(taxi, pd.DataFrame)
        self.assertGreater(taxi.shape[0], 0)

        # function test
        taxi = read_taxi()
        self.assertIsInstance(taxi, pd.DataFrame)
        self.assertGreater(taxi.shape[0], 0)

    def test_read_brooklyn_poverty(self):
        """examples.read_brooklyn_poverty"""
        from cartoframes.examples import read_brooklyn_poverty
        # method test
        bp = self.examples.read_brooklyn_poverty()
        self.assertIsInstance(bp, pd.DataFrame)
        self.assertGreaterEqual(bp.shape[0], 0)

{'fraction_non_alphanumeric': 0.10569800569800569, 'fraction_numerical': 0.003988603988603989, 'mean_word_length': 2.837158469945355, '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': '5135254', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1006, 'n_words': 192}