예제 #1
0
class SlidingWindowTest(unittest.TestCase):
    """
      Unit tests for the SlidingWindow class
    """


    def setUp(self):
        """
          Reconstruct a new sliding window strategy object each iteration
        """

        self.projectRoot = os.environ['PROJECT_ROOT']
        self.slidingWindowStrategy = SlidingWindowStrategy()
        self.maxDiff = 2000

        # Should have complicated split pattern with 5 hour default interval and 5 sub-windows
        self.mockLogData = load(open(self.projectRoot + '/test/strategy/slidingWindow/json/MockLogData.json'))


    def testParseTrainingDataWithEmptyData(self):
        try:
            self.slidingWindowStrategy.parseData([])
            self.fail("Should have thrown an assertion error")
        except AssertionError, error:
            self.assertEqual('Training data for SlidingWindow must be non-empty!', error.message)
예제 #2
0
    def setUp(self):
        """
          Reconstruct a new sliding window strategy object each iteration
        """

        self.projectRoot = os.environ['PROJECT_ROOT']
        self.slidingWindowStrategy = SlidingWindowStrategy()
        self.maxDiff = 2000

        # Should have complicated split pattern with 5 hour default interval and 5 sub-windows
        self.mockLogData = load(open(self.projectRoot + '/test/strategy/slidingWindow/json/MockLogData.json'))