示例#1
0
 def _construct_merge_paths(self, merge):
     for merge_field in merge:
         if isinstance(merge_field, FieldPath):
             yield merge_field
         else:
             yield FieldPath(*parse_field_path(merge_field))
def test_parse_field_path_w_escaped_backslash():
    from google.cloud.firestore_v1 import field_path

    assert field_path.parse_field_path("`a\\\\b`.c.d") == ["a\\b", "c", "d"]
def test_parse_field_path_w_first_name_escaped_wo_closing_backtick():
    from google.cloud.firestore_v1 import field_path

    with pytest.raises(ValueError):
        field_path.parse_field_path("`a\\`b.c.d")
def test_parse_field_path_wo_escaped_names():
    from google.cloud.firestore_v1 import field_path

    assert field_path.parse_field_path("a.b.c") == ["a", "b", "c"]
示例#5
0
    def _call_fut(path):
        from google.cloud.firestore_v1 import field_path

        return field_path.parse_field_path(path)
示例#6
0
 def _construct_merge_paths(self, merge) -> Generator[Any, Any, None]:
     for merge_field in merge:
         if isinstance(merge_field, FieldPath):
             yield merge_field
         else:
             yield FieldPath(*parse_field_path(merge_field))
    def _call_fut(path):
        from google.cloud.firestore_v1 import field_path

        return field_path.parse_field_path(path)
 def _construct_merge_paths(self, merge):
     for merge_field in merge:
         if isinstance(merge_field, FieldPath):
             yield merge_field
         else:
             yield FieldPath(*parse_field_path(merge_field))