# Path: datafeed/exchange.py
# class SH(StockExchange):
#     name = 'Shanghai Stock Exchange'
#     currency = ('¥', 'CNY')
#     timezone = 'Asia/Shanghai'
#     _pre_market_session = ((9, 15), (9, 25))
#     _market_session = ((9, 30), (15, 0))
#     _market_break_session = ((11, 30), (13, 0))
# 
#     # Daily minute data count.
#     market_minutes = 242
# 
# Path: datafeed/tests/helper.py
# def sample_key():
# def sample():
# def sample_minutes():


import h5py
import os
import re
import time
import unittest
import numpy as np
    import shutil
from datetime import datetime
from mock import Mock, patch
from datafeed.exchange import SH
from datafeed.datastore import *
from datafeed.tests import helper

        store.close()
        self.assertRaises(AssertionError, rstore.set, key, sample)
        self.assertRaises(AssertionError, rstore.get, key)

        store = DictStore.open(filename)
        rstore = Report(store)
        self.assertEqual(rstore[key], sample[key])


class DayTest(unittest.TestCase):

    def setUp(self):
        self.store = Day(h5py.File('%s/data.h5' % helper.datadir))

    def test_namespace(self):
        h = self.store.handle
        self.assertTrue(isinstance(h, h5py.Group))
        self.assertEqual(h.name, '/day')

    def test_get_from_not_exist_symbol(self):
        key = 'SH987654'
        self.assertRaises(KeyError, self.store.get, symbol=key, length=1)


class MinuteTest(unittest.TestCase):

    def setUp(self):
        ts = int(time.mktime((2011, 1, 1, 1, 1, 0, 0, 0, 0)))
        date = datetime.fromtimestamp(ts).date()

# Path: datafeed/exchange.py
# class SH(StockExchange):
#     name = 'Shanghai Stock Exchange'
#     currency = ('¥', 'CNY')
#     timezone = 'Asia/Shanghai'
#     _pre_market_session = ((9, 15), (9, 25))
#     _market_session = ((9, 30), (15, 0))
#     _market_break_session = ((11, 30), (13, 0))
# 
#     # Daily minute data count.
#     market_minutes = 242
# 
# Path: datafeed/tests/helper.py
# def sample_key():
# def sample():
# def sample_minutes():


# Path: datafeed/tests/test_datastore.py
import h5py
import os
import re
import time
import unittest
import numpy as np
    import shutil
from datetime import datetime
from mock import Mock, patch
from datafeed.exchange import SH
from datafeed.datastore import *
from datafeed.tests import helper


        store.close()
        self.assertRaises(AssertionError, rstore.set, key, sample)
        self.assertRaises(AssertionError, rstore.get, key)

        store = DictStore.open(filename)
        rstore = Report(store)
        self.assertEqual(rstore[key], sample[key])


class DayTest(unittest.TestCase):

    def setUp(self):
        self.store = Day(h5py.File('%s/data.h5' % helper.datadir))

    def test_namespace(self):
        h = self.store.handle
        self.assertTrue(isinstance(h, h5py.Group))
        self.assertEqual(h.name, '/day')

    def test_get_from_not_exist_symbol(self):
        key = 'SH987654'
        self.assertRaises(KeyError, self.store.get, symbol=key, length=1)


class MinuteTest(unittest.TestCase):

    def setUp(self):
        ts = int(time.mktime((2011, 1, 1, 1, 1, 0, 0, 0, 0)))
        date = datetime.fromtimestamp(ts).date()

        self.store = Minute(h5py.File('%s/data.h5' % helper.datadir),