# 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

        symbol = 'TS123456'
        self.mstore[symbol] = x
        y = self.mstore[symbol]
        np.testing.assert_array_equal(y, x)

    def test_reopen(self):
        x = helper.sample_minutes()

        symbol = 'TS123456'
        self.mstore[symbol] = x

        # closed
        self.store.close()
        self.assertRaises(AssertionError, self.mstore.get, symbol)

        # reopen
        store = DictStore.open(self.filename)
        mstore = MinuteSnapshotCache(store, self.date)

        # testing reopen data
        y = mstore[symbol]
        np.testing.assert_array_equal(y, x)

    def test_rotate(self):
        x = helper.sample_minutes()

        symbol = 'TS123456'
        self.mstore[symbol] = x


# 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


        symbol = 'TS123456'
        self.mstore[symbol] = x
        y = self.mstore[symbol]
        np.testing.assert_array_equal(y, x)

    def test_reopen(self):
        x = helper.sample_minutes()

        symbol = 'TS123456'
        self.mstore[symbol] = x

        # closed
        self.store.close()
        self.assertRaises(AssertionError, self.mstore.get, symbol)

        # reopen
        store = DictStore.open(self.filename)
        mstore = MinuteSnapshotCache(store, self.date)

        # testing reopen data
        y = mstore[symbol]
        np.testing.assert_array_equal(y, x)

    def test_rotate(self):
        x = helper.sample_minutes()

        symbol = 'TS123456'
        self.mstore[symbol] = x


        dbm = Manager(helper.datadir, SH())