<commit_before>""" run with

nosetests -v --nocapture

or

nosetests -v

"""
import sys

from sh import grep
import json
import pprint
pp = pprint.PrettyPrinter(indent=4)


from cloudmesh.config.cm_keys import cm_keys
from cloudmesh.util.util import HEADING
from cloudmesh.util.util import path_expand


class Test_cloudmesh:

    def setup(self):
        config = cm_config_pagestatus()
        self.db = cm_mongo_pagestatus()
        self.db.kill()

    def tearDown(self):
        # TODO decide teardown
        db.kill()

    def test_add(self):
        HEADING()
        db.add('gregor', '/hello', 'VMs', '100')
        db.add('gregor', '/hello', 'images', '99')


        vms = db.get('gregor', '/hello', 'VMs')
        images = db.get('gregor', '/hello', 'images')
        assert vms == 100
        assert images == 99
<commit_msg>added the missing self<commit_after>""" run with

nosetests -v --nocapture

or

nosetests -v

"""
import sys

from sh import grep
import json
import pprint
pp = pprint.PrettyPrinter(indent=4)


from cloudmesh.config.cm_keys import cm_keys
from cloudmesh.util.util import HEADING
from cloudmesh.util.util import path_expand


class Test_cloudmesh:

    def setup(self):
        config = cm_config_pagestatus()
        self.db = cm_mongo_pagestatus()
        self.db.kill()

    def tearDown(self):
        # TODO decide teardown
        db.kill()

    def test_add(self):
        HEADING()
        self.db.add('gregor', '/hello', 'VMs', '100')
        self.db.add('gregor', '/hello', 'images', '99')


        vms = self.db.get('gregor', '/hello', 'VMs')
        images = self.db.get('gregor', '/hello', 'images')
        assert vms == 100
        assert images == 99

{'fraction_non_alphanumeric': 0.13255131964809383, 'fraction_numerical': 0.012903225806451613, 'mean_word_length': 2.6926406926406927, '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': '7187733', 'n_tokens_mistral': 600, 'n_tokens_neox': 565, 'n_words': 149}