# Path: nowtrade/logger.py
# CRITICAL = logging.CRITICAL
# 
# Path: nowtrade/symbol_list.py
# class SymbolList(object):
# class Symbol(object):
#     def __init__(self, symbols):
#     def get(self, symbol):
#     def __repr__(self):
#     def __str__(self):
#     def __iter__(self):
#     def __init__(self, symbol):
#     def __repr__(self):
#     def __str__(self):
#     def __hash__(self):
#     def __eq__(self, other):
#     def custom(self, name):


import unittest
from nowtrade.logger import CRITICAL
from nowtrade.symbol_list import SymbolList, StockList

class TestSymbolList(unittest.TestCase):
    def test_symbol_list(self):
        sanity = ['MSFT', 'GOOG', 'AAPL']
        symbols = ['msft', 'gOOg', 'AAPl']
        stocks = symbols
        symbol_list = SymbolList(symbols)
        self.assertEqual(symbol_list.__repr__(), '[MSFT, GOOG, AAPL]')
        symbol_list.logger.set_console_level(CRITICAL)
        stock_list = StockList(stocks)
        for symbol in symbol_list: sanity.remove(str(symbol))
        self.assertEqual(len(sanity), 0)
        msft = symbol_list.get('msft')
        goog = symbol_list.get('goog')
        self.assertEqual(msft.symbol, 'MSFT')
        self.assertEqual(msft.symbol, 'MSFT')
        self.assertEqual(msft.open, 'MSFT_Open')

# Path: nowtrade/logger.py
# CRITICAL = logging.CRITICAL
# 
# Path: nowtrade/symbol_list.py
# class SymbolList(object):
# class Symbol(object):
#     def __init__(self, symbols):
#     def get(self, symbol):
#     def __repr__(self):
#     def __str__(self):
#     def __iter__(self):
#     def __init__(self, symbol):
#     def __repr__(self):
#     def __str__(self):
#     def __hash__(self):
#     def __eq__(self, other):
#     def custom(self, name):


# Path: tests/test_symbol_list.py
import unittest
from nowtrade.logger import CRITICAL
from nowtrade.symbol_list import SymbolList, StockList


class TestSymbolList(unittest.TestCase):
    def test_symbol_list(self):
        sanity = ['MSFT', 'GOOG', 'AAPL']
        symbols = ['msft', 'gOOg', 'AAPl']
        stocks = symbols
        symbol_list = SymbolList(symbols)
        self.assertEqual(symbol_list.__repr__(), '[MSFT, GOOG, AAPL]')
        symbol_list.logger.set_console_level(CRITICAL)
        stock_list = StockList(stocks)
        for symbol in symbol_list: sanity.remove(str(symbol))
        self.assertEqual(len(sanity), 0)
        msft = symbol_list.get('msft')
        goog = symbol_list.get('goog')
        self.assertEqual(msft.symbol, 'MSFT')
        self.assertEqual(msft.symbol, 'MSFT')
        self.assertEqual(msft.open, 'MSFT_Open')

        self.assertEqual(msft.high, 'MSFT_High')