<commit_before>"""
Tests for Notebook Utilities

Functions
---------
fetch_nb_dependencies

"""

from quantecon.util import fetch_nb_dependencies
import unittest

FILES = ['README.md']
REPO = "https://github.com/QuantEcon/QuantEcon.py"
RAW = "raw"
BRANCH = "master"

class TestNotebookUtils(unittest.TestCase):

    def test_fetch_nb_dependencies(self):
        """
        Run First and Test Download
        """
        status = fetch_nb_dependencies(files=FILES, repo=REPO, raw=RAW, branch=BRANCH)
        self.assertFalse(False in status)

    def test_fetch_nb_dependencies_overwrite(self):
        """
        Run Second and Ensure file is skipped by checking a False is found in status
        """
        status = fetch_nb_dependencies(files=FILES, repo=REPO, raw=RAW, branch=BRANCH)
        self.assertTrue(False in status)<commit_msg>improve cleanup process of test by removing the downloaded file<commit_after>"""
Tests for Notebook Utilities

Functions
---------
fetch_nb_dependencies

"""

from quantecon.util import fetch_nb_dependencies
import unittest
import os

FILES = ['README.md']
REPO = "https://github.com/QuantEcon/QuantEcon.py"
RAW = "raw"
BRANCH = "master"

class TestNotebookUtils(unittest.TestCase):

    def test_fetch_nb_dependencies(self):
        """
        Run First and Test Download
        """
        status = fetch_nb_dependencies(files=FILES, repo=REPO, raw=RAW, branch=BRANCH)
        self.assertFalse(False in status)

    def test_fetch_nb_dependencies_overwrite(self):
        """
        Run Second and Ensure file is skipped by checking a False is found in status
        """
        status = fetch_nb_dependencies(files=FILES, repo=REPO, raw=RAW, branch=BRANCH)  #First will succeed
        status = fetch_nb_dependencies(files=FILES, repo=REPO, raw=RAW, branch=BRANCH)  #Second should skip
        self.assertTrue(False in status)

    def tearDown(self):
        os.remove("README.md")
{'fraction_non_alphanumeric': 0.10294878427315055, 'fraction_numerical': 0.0, 'mean_word_length': 3.4976744186046513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4539605', 'n_tokens_mistral': 608, 'n_tokens_neox': 573, 'n_words': 150}