2

Google App Engines New DBでPythonフィクスチャモジュールを使用する方法に関する適切な情報はありますか?

次のようないくつかの問題があるようです。

  1. obj.delete()分解時 (ndbその中obj.key.delete())

  2. ネストされたStructuredProperty要素を設定する方法は直感的ではありません。

ndbフィクスチャ モジュールまたは で動作する代替フィクスチャ システムを許可する回避策はありndbますか?

ありがとうございました。

4

2 に答える 2

2

I'm guessing that fixture's GoogleDatastoreFixture class intercepts the Datastore operations at the ext.db module level. Since NDB has a different API it needs changing. Perhaps you can contribute a GoogleNdbFixture class. Or perhaps the right thing to do would be to intercept things at a lower level -- again, something you might take up with fixture's author and see if there's a way you can help.

于 2012-04-01T03:56:34.537 に答える
1

Testbed の使用を検討しましたか? GAE サービス スタブを適切にセットアップするため、データストア (およびその他のサービス) に対してテストを行うことができ、各テストの後にすべてのデータストアへの書き込みを破棄します。

setUp()テスト用のフィクスチャを作成するには、いくつかのエンティティをメソッド内のデータストアに直接配置するだけです。また、必要に応じて、NDB API を使用してフィクスチャを配置したり、テストを実行したりできます。

于 2012-03-29T07:26:43.517 に答える