<commit_before>import unittest
import mock
from time import sleep
from opc import OPCN2
from opc.exceptions import SPIError, FirmwareError
import spidev

interval = 1

'''
class MockSpiDev(spidev.SpiDev):
    def __init__(self):
        super(MockSpiDev, self).__init__(**kwargs)

    def open(bus, device):
        return True

    def xfer(vals = []):
        return True

    def readbytes(n):
        return True

    def writebytes(vals = []):
        return True

    def close():
        return True

#class MockOPC(OPCN2):

'''
class SetupTestCase(unittest.TestCase):

    def setUp(self):
        self.spi = spidev.SpiDev()

        self.assertIsInstance(self.spi, spidev.SpiDev)

    def tearDown(self):
        pass

    def setUp(self):
        self.spi = spidev.SpiDev()
        self.spi.open(0, 0)
        self.spi.mode = 1
        self.spi.max_speed_hz = 500000

        self.alpha = OPCN2(self.spi, debug = True)
        #self.assertRaises(SPIError, OPCN2, None)

    def tearDown(self):
        pass

    def test_spi(self):
        sleep(interval)
        self.assertIsInstance(self.spi, spidev.SpiDev)

    '''
    def test_firmware(self):
        sleep(interval)
        self.assertTrue(self.alpha.firmware in [14, 15, 16, 17])

    def test_opc(self):
        # Turn on the opc
        sleep(interval)
        self.assertTrue(self.alpha.on())
        sleep(interval)
        self.assertTrue(self.alpha.off())

    def test_ping(self):
        sleep(interval)
        self.assertTrue(self.alpha.ping())

    def test_read_info_string(self):
        sleep(interval)<commit_msg>remove testing until proper mocking is done<commit_after>import unittest
import mock
from time import sleep
from opc import OPCN2
from opc.exceptions import SPIError, FirmwareError
import spidev

interval = 1

'''
class MockSpiDev(spidev.SpiDev):
    def __init__(self):
        super(MockSpiDev, self).__init__(**kwargs)

    def open(bus, device):
        return True

    def xfer(vals = []):
        return True

    def readbytes(n):
        return True

    def writebytes(vals = []):
        return True

    def close():
        return True

#class MockOPC(OPCN2):

'''
class SetupTestCase(unittest.TestCase):

    def setUp(self):
        self.spi = spidev.SpiDev()

        self.assertIsInstance(self.spi, spidev.SpiDev)

    def tearDown(self):
        pass

    def setUp(self):
        self.spi = spidev.SpiDev()
        self.spi.open(0, 0)
        self.spi.mode = 1
        self.spi.max_speed_hz = 500000

        self.alpha = OPCN2(self.spi, debug = True)
        #self.assertRaises(SPIError, OPCN2, None)

    def tearDown(self):
        pass
        
    '''
    def test_spi(self):
        sleep(interval)
        self.assertIsInstance(self.spi, spidev.SpiDev)

    def test_firmware(self):
        sleep(interval)
        self.assertTrue(self.alpha.firmware in [14, 15, 16, 17])

    def test_opc(self):
        # Turn on the opc
        sleep(interval)
        self.assertTrue(self.alpha.on())
        sleep(interval)
        self.assertTrue(self.alpha.off())

    def test_ping(self):
        sleep(interval)
        self.assertTrue(self.alpha.ping())

    def test_read_info_string(self):
        sleep(interval)
{'fraction_non_alphanumeric': 0.10959752321981424, 'fraction_numerical': 0.013622291021671827, 'mean_word_length': 2.3903462749213014, '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': '576228', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1051, 'n_words': 229}