@@ -28,6 +28,16 @@ def _get_target_class():
28
28
29
29
return CopyJobConfig
30
30
31
+ def test_ctor_defaults (self ):
32
+ from google .cloud .bigquery .job import OperationType
33
+
34
+ config = self ._make_one ()
35
+
36
+ assert config .create_disposition is None
37
+ assert config .write_disposition is None
38
+ assert config .destination_encryption_configuration is None
39
+ assert config .operation_type == OperationType .OPERATION_TYPE_UNSPECIFIED
40
+
31
41
def test_ctor_w_properties (self ):
32
42
from google .cloud .bigquery .job import CreateDisposition
33
43
from google .cloud .bigquery .job import OperationType
@@ -76,19 +86,21 @@ def test_to_api_repr_with_encryption_none(self):
76
86
resource , {"copy" : {"destinationEncryptionConfiguration" : None }}
77
87
)
78
88
79
- def test_operation_type_unspecified (self ):
89
+ def test_operation_type_setting_none (self ):
80
90
from google .cloud .bigquery .job import OperationType
81
91
82
- config = self ._make_one ()
83
- self .assertEqual (
84
- config .operation_type , OperationType .OPERATION_TYPE_UNSPECIFIED
85
- )
92
+ config = self ._make_one (operation_type = OperationType .SNAPSHOT )
86
93
87
94
# Setting it to None is the same as setting it to OPERATION_TYPE_UNSPECIFIED.
88
95
config .operation_type = None
89
- self .assertEqual (
90
- config .operation_type , OperationType .OPERATION_TYPE_UNSPECIFIED
91
- )
96
+ assert config .operation_type == OperationType .OPERATION_TYPE_UNSPECIFIED
97
+
98
+ def test_operation_type_setting_non_none (self ):
99
+ from google .cloud .bigquery .job import OperationType
100
+
101
+ config = self ._make_one (operation_type = None )
102
+ config .operation_type = OperationType .RESTORE
103
+ assert config .operation_type == OperationType .RESTORE
92
104
93
105
94
106
class TestCopyJob (_Base ):
0 commit comments