<commit_before>"""
VerseBot for reddit
By <NAME>
tests.py
Copyright (c) 2015 <NAME> (MIT License)
"""

import unittest
import sys
import os
import logging

sys.path.append(os.path.join('..', 'versebot'))
import database
import books
import regex
import webparser
import verse

class TestBookRetrieval(unittest.TestCase):
    """ Tests book retrieval and parsing functions. """
    
    def test_book_standardization(self):
        """ Tests book conversion to standardized book names. """
        self.assertTrue(books.get_book("1 Jn") == "1 John")
        self.assertTrue(books.get_book("ti") == "Titus")
        self.assertTrue(books.get_book("thisisntabook") == False)
    
    def test_book_number_retrieval(self):
        """ Tests book number retrieval. """
        self.assertTrue(books.get_book_number("Genesis") == 1)
        self.assertTrue(books.get_book_number("Bel and the Dragon") == 82)
        self.assertTrue(books.get_book_number("thisisntabook") == False)
        
    def test_tanakh_name_retrieval(self):
        """ Tests TaggedTanakh URL book name retrieval. """
        self.assertTrue(books.get_tanakh_name("Genesis") == "Gen")
        self.assertTrue(books.get_tanakh_name("2 Chronicles") == "2%20Chron")
        
        
class TestBibleGatewayParsing(unittest.TestCase):
    """ Tests parsing of BibleGateway webpages. """<commit_msg>Fixed two unit tests and removed one<commit_after>"""
VerseBot for reddit
By <NAME>
tests.py
Copyright (c) 2015 <NAME> (MIT License)
"""

import unittest
import sys
import os
import logging

sys.path.append(os.path.join('..', 'versebot'))
import database
import books
import regex
import webparser
import verse

class TestBookRetrieval(unittest.TestCase):
    """ Tests book retrieval and parsing functions. """
    
    def test_book_standardization(self):
        """ Tests book conversion to standardized book names. """
        self.assertTrue(books.get_book("1 Jn") == "1 John")
        self.assertTrue(books.get_book("ti") == "Titus")
        self.assertTrue(books.get_book("thisisntabook") is None)
    
    def test_book_number_retrieval(self):
        """ Tests book number retrieval. """
        self.assertTrue(books.get_book_number("Genesis") == 1)
        self.assertTrue(books.get_book_number("Bel and the Dragon") == 82)
        self.assertTrue(books.get_book_number("thisisntabook") is None)
        
        
class TestBibleGatewayParsing(unittest.TestCase):
    """ Tests parsing of BibleGateway webpages. """
{'fraction_non_alphanumeric': 0.1241462434712736, 'fraction_numerical': 0.008838891120932101, 'mean_word_length': 3.7338403041825097, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '56384', 'n_tokens_mistral': 761, 'n_tokens_neox': 751, 'n_words': 181}