2013-05-15 38 views
1

首先,我對GAE/Python很陌生,請耐心等待。這裏的情況GAE Python測試

有一個test_all.py它測試我的包中的所有測試套件。 TestCase的setUp目前看起來像;

import test_settings as policy # has consistency variables <- does not work 

... 

def setUp(self): 
    # First, create an instance of the Testbed class. 
    self.testbed = testbed.Testbed() 
    # Then activate the testbed, which prepares the service stubs for use. 
    self.testbed.activate() 
    # Consistency policy nomal operations 
    self.policy = None 
    if policy.policy_flag == 'STRICT': 
     # Create a consistency policy that will simulate the High Replication consistency model. 
     self.policy = datastore_stub_util.PseudoRandomHRConsistencyPolicy(probability=0) 
    # Initialize the datastore stub with this policy. 
    self.testbed.init_datastore_v3_stub(consistency_policy=self.policy) 

這是我設法用不同的一致性策略對數據存儲進行測試的原始嘗試。總失敗。

我想是反對不同的數據存儲的一致性一氣呵成,從我的根test_all.py使用上述或其他運行我的測試情況下,我怎麼能做到這一點?我如何從測試運行器傳遞參數給TestCase?

+0

重新「完全失敗」 - 你能顯示錯誤,或者你得到了什麼與你的期望? – ckhan

+0

policy_flat只是一個不同模塊中的變量。我*相信*我所做的更改不會傳播到測試用例中的「導入」中。因此,測試僅以默認開始一致性運行。是否有可能從runner發送參數到TestCase類? –

回答