本文整理匯總了Python中phildb.database.PhilDB.list_measurands方法的典型用法代碼示例。如果您正苦於以下問題:Python PhilDB.list_measurands方法的具體用法?Python PhilDB.list_measurands怎麽用?Python PhilDB.list_measurands使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phildb.database.PhilDB
的用法示例。
在下文中一共展示了PhilDB.list_measurands方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_multiple_db_instances
# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import list_measurands [as 別名]
def test_multiple_db_instances(self):
db1 = PhilDB(self.test_tsdb)
db2 = PhilDB(self.second_test_db)
self.assertEqual(db1.list_measurands()[0], 'Q')
self.assertEqual(db2.list_measurands()[0], '2')
self.assertEqual(db2.list_measurands()[1], 'Q')
示例2: test_measurand_list_sorted
# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import list_measurands [as 別名]
def test_measurand_list_sorted(self):
"""
Test that the list of measurand short IDs is sorted.
"""
db = PhilDB(self.test_tsdb)
db.add_measurand('P', 'PRECIPITATION', 'Precipitation')
ts_list = db.list_measurands()
self.assertEqual(['P', 'Q'], ts_list)