# Path: nowtrade/criteria_group.py
# class InvalidAction(Exception):
# class CriteriaGroup(object):
#     def __init__(self, criteria_list, action, symbol):
#     def __str__(self):
#     def __repr__(self):
#     def get_result(self, data_frame):
# 
# Path: nowtrade/strategy.py
# class Strategy(object):
#     def __init__(self, dataset, criteria_groups, trading_profile):
#     def __str__(self):
#     def __repr__(self):
#     def simulate(self):
#     def process_new_data(self, data):
#     def get_next_action(self):
#     def _determine_action(self, values):
#     def _get_status(self, symbol):
#     def _create_actions_status_columns(self, data_frame, symbol):
# 
# Path: nowtrade/action.py
# class Long(Action):
#     """
#     Long Action represents going long in the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'long')
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return LONG
# 
# class Short(Action):
#     """
#     Short Action represents shorting in the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'short')
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return SHORT
# 
# class LongExit(Action):
#     """
#     Long Exit Action represents exiting a long position from the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'longexit')
#     def __eq__(self, other):
#         other = str(other).replace(' ', '').replace('_', '').replace('-', '').lower()
#         return other == 'longexit' or other == 'exitlong'
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return LONG_EXIT
# 
# class ShortExit(Action):
#     """
#     Short Exit Action represents exiting a short position from the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'shortexit')
#     def __eq__(self, other):
#         other = str(other).replace(' ', '').replace('_', '').replace('-', '').lower()
#         return other == 'shortexit' or other == 'exitshort'
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return SHORT_EXIT


import unittest
import pandas as pd
import numpy as np
from nowtrade import criteria_group, strategy
from nowtrade.action import Long, Short, LongExit, ShortExit
from testing_data import DummyCriteria, msft_data

class TestCriteriaGroup(unittest.TestCase):
    def test_criteria_group(self):
        criteria_list = [DummyCriteria(True), DummyCriteria(True)]
        with self.assertRaises(criteria_group.InvalidAction):
            cg = criteria_group.CriteriaGroup(criteria_list, 'INVALID', 'MSFT')

# Path: nowtrade/criteria_group.py
# class InvalidAction(Exception):
# class CriteriaGroup(object):
#     def __init__(self, criteria_list, action, symbol):
#     def __str__(self):
#     def __repr__(self):
#     def get_result(self, data_frame):
# 
# Path: nowtrade/strategy.py
# class Strategy(object):
#     def __init__(self, dataset, criteria_groups, trading_profile):
#     def __str__(self):
#     def __repr__(self):
#     def simulate(self):
#     def process_new_data(self, data):
#     def get_next_action(self):
#     def _determine_action(self, values):
#     def _get_status(self, symbol):
#     def _create_actions_status_columns(self, data_frame, symbol):
# 
# Path: nowtrade/action.py
# class Long(Action):
#     """
#     Long Action represents going long in the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'long')
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return LONG
# 
# class Short(Action):
#     """
#     Short Action represents shorting in the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'short')
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return SHORT
# 
# class LongExit(Action):
#     """
#     Long Exit Action represents exiting a long position from the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'longexit')
#     def __eq__(self, other):
#         other = str(other).replace(' ', '').replace('_', '').replace('-', '').lower()
#         return other == 'longexit' or other == 'exitlong'
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return LONG_EXIT
# 
# class ShortExit(Action):
#     """
#     Short Exit Action represents exiting a short position from the market.
#     """
#     def __init__(self):
#         Action.__init__(self, 'shortexit')
#     def __eq__(self, other):
#         other = str(other).replace(' ', '').replace('_', '').replace('-', '').lower()
#         return other == 'shortexit' or other == 'exitshort'
#     def raw(self):
#         """
#         A raw (int) representation of the action.
#         """
#         return SHORT_EXIT


# Path: tests/test_criteria_group.py
import unittest
import pandas as pd
import numpy as np
from nowtrade import criteria_group, strategy
from nowtrade.action import Long, Short, LongExit, ShortExit
from testing_data import DummyCriteria, msft_data


class TestCriteriaGroup(unittest.TestCase):
    def test_criteria_group(self):
        criteria_list = [DummyCriteria(True), DummyCriteria(True)]
        with self.assertRaises(criteria_group.InvalidAction):
            cg = criteria_group.CriteriaGroup(criteria_list, 'INVALID', 'MSFT')

        cg = criteria_group.CriteriaGroup(criteria_list, Long(), 'MSFT')