<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Tests API of the TEC_Langmuir class.

These tests can be considered "logical testing" as described in the README. The definition of "logical testing" define the scope and purpose of these tests.

Please note that TEC objects (and their children) have attributes of type "Electrode." These tests do not test functionality of these Electrode attributes -- for example attempting to set illegal values for the temp of the Emitter attribute.
"""

__author__ = "<NAME> (<EMAIL>)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2013 <NAME>"
__license__ = ""

from tec import TEC_Langmuir
from scipy import interpolate
import unittest

class Instantiation(unittest.TestCase):
  """
  Tests to see if the object can even be created.
  """
  
  def setUp(self):
    """
    Set up a dictionary that can properly instantiate a TEC_Langmuir object.
    """

    em_params = {"temp":1,\
                 "barrier_ht":1,\
                 "voltage":1,\
                 "position":0,\
                 "richardson":10,\
                 "emissivity":0.5}
                   
    co_params = {"temp":1,\
                 "barrier_ht":1,\
                 "voltage":1,\
                 "position":0,\
                 "richardson":10,\
                 "emissivity":0.5}
                 
    input_params = {"Emitter":em_params, "Collector":co_params}
                   
    self.input_params = input_params
    
  def test_TEC_Langmuir_instantiation_type(self):
    """
    Tests instantation and proper return type of TEC_Langmuir object.
    """
    TECL = TEC_Langmuir(self.input_params)
    self.assertTrue(isinstance(TECL,TEC_Langmuir))
    
class motive_dataInterface(unittest.TestCase):
  """
  TEC_Langmuir motive_data interface implements description in class docstring.
  """
  def setUp(self):
    """
    Set up a generic TEC_Langmuir object.
    """
    
    # TEC_Langmuir test object.
    em_params = {"temp":1,\
                 "barrier_ht":1,\
                 "voltage":1,\
                 "position":0,\
                 "richardson":10,\
                 "emissivity":0.5}
                   
    co_params = {"temp":1,\
                 "barrier_ht":1,\
                 "voltage":1,\
                 "position":0,\
                 "richardson":10,\
                 "emissivity":0.5}
                 
    input_params = {"Emitter":em_params, "Collector":co_params}
    self.TECL = TEC_Langmuir(input_params)
    
  def test_motive_data_exists(self):
    """
    motive_data should exist.
    """
    self.assertTrue("motive_data" in self.TECL)
  
  def test_motive_data_is_dict(self):
    """
    motive_data is a dictionary.
    """
    self.assertTrue(isinstance(self.TECL["motive_data"],dict))
    
  # What follows is possibly the jankiest way to test the interface of motive_data
  def test_motive_data_saturation_pt_exists(self):
    """
    TECL["motive_data"]["saturation_pt"] should exist.
    """
    self.assertTrue("saturation_pt" in self.TECL["motive_data"])


if __name__ == '__main__':
  unittest.main()<commit_msg>Removed interface tests since they are now doctests in the class itself.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Tests API of the TEC_Langmuir class.

These tests can be considered "logical testing" as described in the README. The definition of "logical testing" define the scope and purpose of these tests.

Please note that TEC objects (and their children) have attributes of type "Electrode." These tests do not test functionality of these Electrode attributes -- for example attempting to set illegal values for the temp of the Emitter attribute.
"""

__author__ = "<NAME> (<EMAIL>)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2013 <NAME>"
__license__ = ""

from tec import TEC_Langmuir
from scipy import interpolate
import unittest

if __name__ == '__main__':
  unittest.main()
{'fraction_non_alphanumeric': 0.1082657200811359, 'fraction_numerical': 0.010649087221095335, 'mean_word_length': 2.550855085508551, 'pattern_counts': {'":': 28, '<': 9, '<?xml version=': 0, '>': 9, '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': '3719499', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1175, 'n_words': 336}