当前位置: 首页>>代码示例>>Python>>正文


Python values.CollectionState类代码示例

本文整理汇总了Python中shinysdr.values.CollectionState的典型用法代码示例。如果您正苦于以下问题:Python CollectionState类的具体用法?Python CollectionState怎么用?Python CollectionState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CollectionState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, time_source=the_reactor):
     self.__interesting_objects = CellDict(dynamic=True)
     CollectionState.__init__(self, self.__interesting_objects)
     self.__objects = {}
     self.__expiry_times = {}
     self.__time_source = IReactorTime(time_source)
     self.__flush_call = None
开发者ID:thefinn93,项目名称:shinysdr,代码行数:7,代码来源:telemetry.py

示例2: test_undefined

 def test_undefined(self):
     """no state_insert method defined"""
     self.object = CollectionState(CellDict(dynamic=True))
     self.object.state_from_json({'foo': {'fail': True}})
     # throws but exception is caught -- TODO: Test logging
     self.assertEqual([], list(self.object.state().keys()))
     self.flushLoggedErrors(ValueError)
开发者ID:kpreid,项目名称:shinysdr,代码行数:7,代码来源:test_values.py

示例3: TestStateInsert

class TestStateInsert(unittest.TestCase):
    object = None
    
    def test_success(self):
        self.object = InsertFailSpecimen()
        self.object.state_from_json({'foo': {'fail': False}})
        self.assertEqual(['foo'], self.object.state().keys())
    
    def test_failure(self):
        self.object = InsertFailSpecimen()
        self.object.state_from_json({'foo': {'fail': True}})
        # throws but exception is caught
        self.assertEqual([], self.object.state().keys())
    
    def test_undefined(self):
        '''no state_insert method defined'''
        self.object = CollectionState({}, dynamic=True)
        self.object.state_from_json({'foo': {'fail': True}})
        # throws but exception is caught
        self.assertEqual([], self.object.state().keys())
开发者ID:nunb,项目名称:shinysdr,代码行数:20,代码来源:test_values.py

示例4: TestStateInsert

class TestStateInsert(unittest.TestCase):
    object = None
    
    def test_success(self):
        self.object = InsertFailSpecimen()
        self.object.state_from_json({'foo': {'fail': False}})
        self.assertEqual(['foo'], list(self.object.state().keys()))
    
    def test_failure(self):
        self.object = InsertFailSpecimen()
        self.object.state_from_json({'foo': {'fail': True}})
        # throws but exception is caught -- TODO: Test logging
        self.assertEqual([], list(self.object.state().keys()))
        self.flushLoggedErrors(ValueError)
    
    def test_undefined(self):
        """no state_insert method defined"""
        self.object = CollectionState(CellDict(dynamic=True))
        self.object.state_from_json({'foo': {'fail': True}})
        # throws but exception is caught -- TODO: Test logging
        self.assertEqual([], list(self.object.state().keys()))
        self.flushLoggedErrors(ValueError)
开发者ID:kpreid,项目名称:shinysdr,代码行数:22,代码来源:test_values.py

示例5: TestCollectionStream

class TestCollectionStream(StateStreamTestCase):
	def setUp(self):
		self.d = {'a': ExportedState()}
		self.object = CollectionState(self.d, dynamic=True)
		StateStreamTestCase.setUp(self)
	
	def test_delete(self):
		self.assertEqual(self.getUpdates(), [
			['register_block', 1, 'urlroot'],
			['register_cell', 2, 'urlroot/a', self.object.state()['a'].description()],
			['register_block', 3, 'urlroot/a'],
			['value', 3, {}],
			['value', 2, 3],
			['value', 1, {'a': 2}],
			['value', 0, 1],
		])
		self.assertEqual(self.getUpdates(), [])
		del self.d['a']
		self.assertEqual(self.getUpdates(), [
			['value', 1, {}],
			['delete', 2],
			['delete', 3],
		])
开发者ID:WindyCitySDR,项目名称:shinysdr,代码行数:23,代码来源:test_web.py

示例6: setUp

	def setUp(self):
		self.d = {'a': ExportedState()}
		self.object = CollectionState(self.d, dynamic=True)
		StateStreamTestCase.setUp(self)
开发者ID:WindyCitySDR,项目名称:shinysdr,代码行数:4,代码来源:test_web.py

示例7: __init__

 def __init__(self, table, top):
     CollectionState.__init__(self, table)
     self.__top = top
开发者ID:kpreid,项目名称:shinysdr,代码行数:3,代码来源:top.py

示例8: __init__

 def __init__(self):
     self.__aircraft = {}
     self.__interesting_aircraft = {}
     CollectionState.__init__(self, self.__interesting_aircraft, dynamic=True)
开发者ID:gstark307,项目名称:shinysdr,代码行数:4,代码来源:__init__.py

示例9: __init__

 def __init__(self):
     self.table = {}
     CollectionState.__init__(self, self.table, dynamic=True)
开发者ID:nunb,项目名称:shinysdr,代码行数:3,代码来源:test_values.py

示例10: __init__

 def __init__(self):
     self.table = CellDict(dynamic=True)
     CollectionState.__init__(self, self.table)
开发者ID:thefinn93,项目名称:shinysdr,代码行数:3,代码来源:test_values.py

示例11: __init__

 def __init__(self, cap_table, unserializer):
     self.__cap_table = cap_table
     self.__unserializer = unserializer
     CollectionState.__init__(self, cap_table._get_cap_dict())
开发者ID:kpreid,项目名称:shinysdr,代码行数:4,代码来源:roots.py

示例12: __init__

 def __init__(self):
     self.__stations = {}
     CollectionState.__init__(self, self.__stations, dynamic=True)
开发者ID:langxj,项目名称:shinysdr,代码行数:3,代码来源:__init__.py

示例13: test_undefined

 def test_undefined(self):
     '''no state_insert method defined'''
     self.object = CollectionState({}, dynamic=True)
     self.object.state_from_json({'foo': {'fail': True}})
     # throws but exception is caught
     self.assertEqual([], self.object.state().keys())
开发者ID:nunb,项目名称:shinysdr,代码行数:6,代码来源:test_values.py

示例14: __init__

	def __init__(self, table, top):
		CollectionState.__init__(self, table, dynamic=True)
		self.__top = top
开发者ID:shadown,项目名称:shinysdr,代码行数:3,代码来源:top.py

示例15: __init__

 def __init__(self, time_source=the_reactor):
     self.__interesting_objects = {}
     CollectionState.__init__(self, self.__interesting_objects, dynamic=True)
     self.__objects = {}
     self.__expiry_times = {}
     self.__time_source = IReactorTime(time_source)
开发者ID:Analias,项目名称:shinysdr,代码行数:6,代码来源:telemetry.py


注:本文中的shinysdr.values.CollectionState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。