コード例 #1
0
ファイル: integer.py プロジェクト: msrb/samba
    def test_hyper_into_int32(self):
        s = srvsvc.NetRemoteTODInfo()

        def assign():
            s.timezone = server_id.SERVERID_UNIQUE_ID_NOT_TO_VERIFY

        self.assertRaises(OverflowError, assign)
コード例 #2
0
ファイル: integer.py プロジェクト: msrb/samba
    def test_int_float_into_int32(self):
        s = srvsvc.NetRemoteTODInfo()

        def assign():
            s.timezone = 2.0

        self.assertRaises(TypeError, assign)
コード例 #3
0
ファイル: integer.py プロジェクト: msrb/samba
    def test_larger_long_int_into_int32(self):
        s = srvsvc.NetRemoteTODInfo()

        def assign():
            s.timezone = 2147483648

        self.assertRaises(OverflowError, assign)
コード例 #4
0
ファイル: integer.py プロジェクト: msrb/samba
    def test_uint32_into_int32(self):
        s = srvsvc.NetRemoteTODInfo()

        def assign():
            s.timezone = server_id.NONCLUSTER_VNN

        self.assertRaises(OverflowError, assign)
コード例 #5
0
 def test_long_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     # here we force python2 to convert its 32/64 bit python int into
     # an arbitrarily long python long, then reduce the number back
     # down to something that would fit in an int anyway. In a pure
     # python2 world, you could achieve the same thing by writing
     #    s.timezone = 5L
     # but that is a syntax error in py3.
     s.timezone = (5 << 65) >> 65
     self.assertEqual(s.timezone, 5)
コード例 #6
0
ファイル: integer.py プロジェクト: msrb/samba
 def test_larger_int_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     s.timezone = 2147483647
コード例 #7
0
ファイル: integer.py プロジェクト: msrb/samba
 def test_long_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     s.timezone = 5L
コード例 #8
0
ファイル: integer.py プロジェクト: msrb/samba
 def test_negative_int_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     s.timezone = -2147483648
コード例 #9
0
ファイル: integer.py プロジェクト: amitkumar50/samba-ldb-mdb
 def test_larger_int_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     s.timezone = 2147483647
     self.assertEquals(s.timezone, 2147483647)
コード例 #10
0
ファイル: integer.py プロジェクト: amitkumar50/samba-ldb-mdb
 def test_long_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     s.timezone = 5L
     self.assertEquals(s.timezone, 5)
コード例 #11
0
ファイル: integer.py プロジェクト: amitkumar50/samba-ldb-mdb
 def test_negative_int_into_int32(self):
     s = srvsvc.NetRemoteTODInfo()
     s.timezone = -2147483648
     self.assertEquals(s.timezone, -2147483648)