<commit_before>'''
Created on Jan 20, 2016

@author: kashefy
'''
from nose.tools import assert_equal, assert_true, assert_list_equal,\
    assert_is_not_none
import os
import tempfile
import shutil
import numpy as np
import proto_utils as pu

import sys
CURRENT_MODULE_PATH = os.path.abspath(sys.modules[__name__].__file__)
TEST_DATA_DIRNAME = 'test_data'
TEST_NET_FILENAME = 'n1.prototxt'
        
class TestProtoUtils:

    @classmethod
    def setup_class(self):
        
        self.dir_tmp = tempfile.mkdtemp()
        
    @classmethod
    def teardown_class(self):
        
        shutil.rmtree(self.dir_tmp)
    
    def test_from_net_params_file(self):
        
        fpath = os.path.join(os.path.dirname(CURRENT_MODULE_PATH),
                             TEST_DATA_DIRNAME, TEST_NET_FILENAME)
        
        parser = pu.Parser()
        net_spec = parser.from_net_params_file(fpath)
        
        assert_is_not_none(net_spec)
        <commit_msg>cleanup test class<commit_after>'''
Created on Jan 20, 2016

@author: kashefy
'''
from nose.tools import assert_is_not_none
import os
import proto_utils as pu

import sys
CURRENT_MODULE_PATH = os.path.abspath(sys.modules[__name__].__file__)
TEST_DATA_DIRNAME = 'test_data'
TEST_NET_FILENAME = 'n1.prototxt'
        
class TestProtoUtils:
    
    def test_from_net_params_file(self):
        
        fpath = os.path.join(os.path.dirname(CURRENT_MODULE_PATH),
                             TEST_DATA_DIRNAME, TEST_NET_FILENAME)
        
        parser = pu.Parser()
        net_spec = parser.from_net_params_file(fpath)
        
        assert_is_not_none(net_spec)
        
{'fraction_non_alphanumeric': 0.07875457875457875, 'fraction_numerical': 0.008547008547008548, 'mean_word_length': 2.7165532879818595, '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': '3995443', 'n_tokens_mistral': 560, 'n_tokens_neox': 540, 'n_words': 100}