@@ -39,6 +39,11 @@ def test_create_model_using_attributes(client):
3939 assert isinstance (result , snippets .Account )
4040
4141
42+ def test_create_model_using_populate (client ):
43+ result = snippets .create_model_using_populate ()
44+ assert isinstance (result , snippets .Account )
45+
46+
4247def test_demonstrate_model_constructor_type_checking (client ):
4348 with pytest .raises (datastore_errors .BadValueError ):
4449 snippets .demonstrate_model_constructor_type_checking ()
@@ -56,6 +61,21 @@ def test_save_model(client):
5661 assert isinstance (result , snippets .ndb .Key )
5762
5863
64+ def test_get_model (client ):
65+ sandy_key = snippets .save_model (
66+ snippets .create_model_using_keyword_arguments ())
67+ result = snippets .get_model (sandy_key )
68+ assert isinstance (result , snippets .Account )
69+
70+
71+ def test_get_key_kind_and_id (client ):
72+ sandy_key = snippets .save_model (
73+ snippets .create_model_using_keyword_arguments ())
74+ kind_string , ident = snippets .get_key_kind_and_id (sandy_key )
75+ assert kind_string == 'Account'
76+ assert isinstance (ident , long )
77+
78+
5979def test_get_url_safe_key (client ):
6080 sandy_key = snippets .save_model (
6181 snippets .create_model_using_keyword_arguments ())
@@ -121,7 +141,11 @@ def test_demonstrate_models_with_parent_hierarchy(client):
121141
122142
123143def test_equivalent_ways_to_define_key_with_parent (client ):
124- result = snippets .equivalent_ways_to_define_key_with_parent ()
144+ snippets .equivalent_ways_to_define_key_with_parent ()
145+
146+
147+ def test_create_root_key (client ):
148+ result = snippets .create_root_key ()
125149 assert result .
id ()
== '[email protected] ' 126150
127151
0 commit comments