@@ -725,7 +725,7 @@ def test_ctor_large_int(self, input_val):
725725
726726 @pytest .mark .parametrize ("input_val" , ["" , "a" , "abc" , "hello world!" ])
727727 def test_ctor_str_value (self , input_val ):
728- with pytest .raises (ValueError ) as e :
728+ with pytest .raises (TypeError ) as e :
729729 self ._make_one (family = "f" , qualifier = b"b" , value = input_val )
730730 assert "value must be int" in str (e .value )
731731
@@ -744,13 +744,10 @@ def test_ctor(self):
744744 assert instance .timestamp_micros == expected_timestamp
745745
746746 def test_ctor_negative_timestamp (self ):
747- """Only positive or -1 timestamps are valid"""
747+ """Only positive timestamps are valid"""
748748 with pytest .raises (ValueError ) as e :
749- self ._make_one ("test-family" , b"test-qualifier" , b"test-value" , - 2 )
750- assert (
751- "timestamp_micros must be positive (or -1 for server-side timestamp)"
752- in str (e .value )
753- )
749+ self ._make_one ("test-family" , b"test-qualifier" , 1234 , - 2 )
750+ assert "timestamp must be positive" in str (e .value )
754751
755752 @pytest .mark .parametrize (
756753 "timestamp_ns,expected_timestamp_micros" ,
@@ -787,8 +784,8 @@ def test__to_dict(self):
787784 got_inner_dict = got_dict ["add_to_cell" ]
788785 assert got_inner_dict ["family_name" ] == expected_family
789786 assert got_inner_dict ["column_qualifier" ]["raw_value" ] == expected_qualifier
790- assert got_inner_dict ["timestamp_micros " ]["raw_timestamp_micros" ] == expected_timestamp
791- assert got_inner_dict ["value " ]["int_value" ] == expected_value
787+ assert got_inner_dict ["timestamp " ]["raw_timestamp_micros" ] == expected_timestamp
788+ assert got_inner_dict ["input " ]["int_value" ] == expected_value
792789 assert len (got_inner_dict .keys ()) == 4
793790
794791 def test__to_pb (self ):
@@ -806,8 +803,8 @@ def test__to_pb(self):
806803 assert isinstance (got_pb , data_pb .Mutation )
807804 assert got_pb .set_cell .family_name == expected_family
808805 assert got_pb .set_cell .column_qualifier .raw_value == expected_qualifier
809- assert got_pb .set_cell .timestamp_micros .raw_timestamp_micros == expected_timestamp
810- assert got_pb .set_cell .value .int_value == expected_value
806+ assert got_pb .set_cell .timestamp .raw_timestamp_micros == expected_timestamp
807+ assert got_pb .set_cell .input .int_value == expected_value
811808
812809 @pytest .mark .parametrize (
813810 "timestamp" ,
@@ -819,18 +816,14 @@ def test__to_pb(self):
819816 (None ),
820817 ],
821818 )
822- def test_is_idempotent (self , timestamp , expected_value ):
823- """is_idempotent is not based on whether an explicit timestamp is set"""
824- instance = self ._make_one (
825- "test-family" , b"test-qualifier" , 1234 , timestamp
826- )
819+ def test_is_idempotent (self , timestamp ):
820+ """is_idempotent is not based on the timestamp"""
821+ instance = self ._make_one ("test-family" , b"test-qualifier" , 1234 , timestamp )
827822 assert not instance .is_idempotent ()
828823
829824 def test___str__ (self ):
830825 """Str representation of mutations should be to_dict"""
831- instance = self ._make_one (
832- "test-family" , b"test-qualifier" , 1234 , 1234567890
833- )
826+ instance = self ._make_one ("test-family" , b"test-qualifier" , 1234 , 1234567890 )
834827 str_value = instance .__str__ ()
835828 dict_value = instance ._to_dict ()
836829 assert str_value == str (dict_value )
0 commit comments