File tree Expand file tree Collapse file tree 2 files changed +1
-13
lines changed
Expand file tree Collapse file tree 2 files changed +1
-13
lines changed Original file line number Diff line number Diff line change 1919
2020import datetime
2121
22- from google .protobuf .internal .type_checkers import Int64ValueChecker
2322import six
2423
2524from gcloud ._helpers import _datetime_from_microseconds
3029
3130__all__ = ('entity_from_protobuf' , 'key_from_protobuf' )
3231
33- INT_VALUE_CHECKER = Int64ValueChecker ()
34-
3532
3633def find_true_project (project , connection ):
3734 """Find the true (unaliased) project.
@@ -318,8 +315,7 @@ def _pb_attr_value(val):
318315 elif isinstance (val , float ):
319316 name , value = 'double' , val
320317 elif isinstance (val , six .integer_types ):
321- INT_VALUE_CHECKER .CheckValue (val ) # Raise an exception if invalid.
322- name , value = 'integer' , int (val ) # Always cast to an integer.
318+ name , value = 'integer' , val
323319 elif isinstance (val , six .text_type ):
324320 name , value = 'string' , val
325321 elif isinstance (val , (bytes , str )):
Original file line number Diff line number Diff line change @@ -457,14 +457,6 @@ def test_long(self):
457457 self .assertEqual (name , 'integer_value' )
458458 self .assertEqual (value , must_be_long )
459459
460- def test_long_too_small (self ):
461- too_small = - (1 << 63 ) - 1
462- self .assertRaises (ValueError , self ._callFUT , too_small )
463-
464- def test_long_too_large (self ):
465- too_large = 1 << 63
466- self .assertRaises (ValueError , self ._callFUT , too_large )
467-
468460 def test_native_str (self ):
469461 import six
470462 name , value = self ._callFUT ('str' )
You can’t perform that action at this time.
0 commit comments