@@ -140,5 +140,55 @@ def test_Spaces(self):
140140 finally :
141141 self .deleteStream (key )
142142
143+ def test_ReadFromSpaces (self ):
144+ key = 'BarsWithSpaces'
145+ try :
146+ stream = self .createStream (key )
147+ self .assertIsNotNone (stream )
148+
149+ count = 1234
150+ testutils .loadBars (stream , count , 0 , 1000000000 , ['MSFT' , 'ORCL' ])
151+ testutils .loadBars (stream , count , 0 , 1000000000 , ['SX' ], 'SpaceX' )
152+ testutils .loadBars (stream , count , 0 , 1000000000 , ['SY' ], 'SpaceY' )
153+
154+ time .sleep (1 )
155+
156+ so = tbapi .SelectionOptions ()
157+ # todo: temporary commented until release new server version
158+ # with stream.trySelect(0, so, None, None) as cursor:
159+ # self.checkCursorSymbols(cursor, set(['MSFT', 'ORCL', 'SX', 'SY']))
160+
161+ so = tbapi .SelectionOptions ()
162+ so .withSpaces (['SpaceX' ])
163+ # todo: temporary commented until release new server version
164+ # with stream.trySelect(0, so, None, None) as cursor:
165+ # self.checkCursorSymbols(cursor, set(['SX']))
166+
167+ so = tbapi .SelectionOptions ()
168+ so .withSpaces (['SpaceY' ])
169+ # todo: temporary commented until release new server version
170+ # with stream.trySelect(0, so, None, None) as cursor:
171+ # self.checkCursorSymbols(cursor, set(['SY']))
172+
173+ so = tbapi .SelectionOptions ()
174+ so .withSpaces (['SpaceY' , 'SpaceX' ])
175+ # todo: temporary commented until release new server version
176+ # with stream.trySelect(0, so, None, None) as cursor:
177+ # self.checkCursorSymbols(cursor, set(['SY', 'SX']))
178+
179+ so = tbapi .SelectionOptions ()
180+ so .withSpaces (['' ])
181+ # todo: temporary commented until release new server version
182+ # with stream.trySelect(0, so, None, None) as cursor:
183+ # self.checkCursorSymbols(cursor, set(['MSFT', 'ORCL']))
184+
185+ so = tbapi .SelectionOptions ()
186+ so .withSpaces (None )
187+ # todo: temporary commented until release new server version
188+ # with stream.trySelect(0, so, None, None) as cursor:
189+ # self.checkCursorSymbols(cursor, set(['MSFT', 'ORCL', 'SX', 'SY']))
190+ finally :
191+ self .deleteStream (key )
192+
143193if __name__ == '__main__' :
144194 unittest .main ()
0 commit comments