<commit_before>import json
import unittest

import logging as log

from urllib2 import urlopen


class TestCouchDbVersion(unittest.TestCase):
    def test_coudb_listening(self):
        urlh = urlopen('http://127.0.0.1:5984/')
        json_data = urlh.read()
        json.loads(json_data)

    def test_couchdb_version(self):
        urlh = urlopen('http://127.0.0.1:5984/')
        json_data = urlh.read()
        couch_info = json.loads(json_data)

        assert 'couchdb' in couch_info
        assert 'version' in couch_info
        assert couch_info['version'] == '1.0.1'


if __name__ == "__main__":
    log.info('Running Version Unit Tests')
    unittest.main()<commit_msg>be less strict about version matching<commit_after>import json
import unittest
import re

import logging as log

from urllib2 import urlopen


class TestCouchDbVersion(unittest.TestCase):
    def test_coudb_listening(self):
        urlh = urlopen('http://127.0.0.1:5984/')
        json_data = urlh.read()
        json.loads(json_data)

    def test_couchdb_version(self):
        urlh = urlopen('http://127.0.0.1:5984/')
        json_data = urlh.read()
        couch_info = json.loads(json_data)

        assert 'couchdb' in couch_info
        assert 'version' in couch_info
        print couch_info['version']
        assert re.match(r"^1\.0\.", couch_info['version'])


if __name__ == "__main__":
    log.info('Running Version Unit Tests')
    unittest.main()
{'fraction_non_alphanumeric': 0.11866759195003469, 'fraction_numerical': 0.03261623872310895, 'mean_word_length': 2.983425414364641, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '1052459', 'n_tokens_mistral': 505, 'n_tokens_neox': 487, 'n_words': 104}