18
18
19
19
class Test_ArrayParamType (unittest .TestCase ):
20
20
def test_it (self ):
21
- from google .cloud .spanner_v1 import Type
22
- from google .cloud .spanner_v1 import TypeCode
23
- from google .cloud .spanner_v1 import param_types
21
+ from google .cloud .spanner_v1 import Type , TypeCode , param_types
24
22
25
23
expected = Type (
26
24
code = TypeCode .ARRAY , array_element_type = Type (code = TypeCode .INT64 )
@@ -33,15 +31,13 @@ def test_it(self):
33
31
34
32
class Test_Struct (unittest .TestCase ):
35
33
def test_it (self ):
36
- from google .cloud .spanner_v1 import Type
37
- from google .cloud .spanner_v1 import TypeCode
38
- from google .cloud .spanner_v1 import StructType
39
- from google .cloud .spanner_v1 import param_types
34
+ from google .cloud .spanner_v1 import StructType , Type , TypeCode , param_types
40
35
41
36
struct_type = StructType (
42
37
fields = [
43
38
StructType .Field (name = "name" , type_ = Type (code = TypeCode .STRING )),
44
39
StructType .Field (name = "count" , type_ = Type (code = TypeCode .INT64 )),
40
+ StructType .Field (name = "float32" , type_ = Type (code = TypeCode .FLOAT32 )),
45
41
]
46
42
)
47
43
expected = Type (code = TypeCode .STRUCT , struct_type = struct_type )
@@ -50,6 +46,7 @@ def test_it(self):
50
46
[
51
47
param_types .StructField ("name" , param_types .STRING ),
52
48
param_types .StructField ("count" , param_types .INT64 ),
49
+ param_types .StructField ("float32" , param_types .FLOAT32 ),
53
50
]
54
51
)
55
52
@@ -58,10 +55,12 @@ def test_it(self):
58
55
59
56
class Test_JsonbParamType (unittest .TestCase ):
60
57
def test_it (self ):
61
- from google .cloud .spanner_v1 import Type
62
- from google .cloud .spanner_v1 import TypeCode
63
- from google .cloud .spanner_v1 import TypeAnnotationCode
64
- from google .cloud .spanner_v1 import param_types
58
+ from google .cloud .spanner_v1 import (
59
+ Type ,
60
+ TypeAnnotationCode ,
61
+ TypeCode ,
62
+ param_types ,
63
+ )
65
64
66
65
expected = Type (
67
66
code = TypeCode .JSON ,
0 commit comments