Example #1
0
def test_umask():
    orig = nt.umask(0)
    try:
        for i in [0, 1, 5, 3.14, int((2**(31))-1)]:
            AreEqual(nt.umask(i), 0)
            
        AssertError(OverflowError, nt.umask, 2**31)
        for i in [None,  "abc", 3j, int]:
            AssertError(TypeError, nt.umask, i)
                    
    finally:
        nt.umask(orig)
Example #2
0
def test_umask():
    orig = nt.umask(0)
    try:
        for i in [0, 1, 5, 3.14, int((2**(31)) - 1)]:
            AreEqual(nt.umask(i), 0)

        AssertError(OverflowError, nt.umask, 2**31)
        for i in [None, "abc", 3j, int]:
            AssertError(TypeError, nt.umask, i)

    finally:
        nt.umask(orig)
Example #3
0
    def test_umask(self):
        orig = nt.umask(0)
        try:
            self.assertRaises(TypeError, nt.umask, 3.14)

            for i in [0, 1, 5, int((2**(31)) - 1)]:
                self.assertEqual(nt.umask(i), 0)

            self.assertRaises(OverflowError, nt.umask, 2**31)
            for i in [None, "abc", 3j, int]:
                self.assertRaises(TypeError, nt.umask, i)

        finally:
            nt.umask(orig)
Example #4
0
    def test_umask(self):
        orig = nt.umask(0)
        try:
            self.assertRaises(TypeError, nt.umask, 3.14)

            for i in [0, 1, 5, int((2**(31))-1)]:
                self.assertEqual(nt.umask(i), 0)
                
            self.assertRaises(OverflowError, nt.umask, 2**31)
            for i in [None,  "abc", 3j, int]:
                self.assertRaises(TypeError, nt.umask, i)
            
        finally:
            nt.umask(orig)
Example #5
0
def test_umask():
    orig = nt.umask(0)
    try:
       
        if is_cpython: #http://ironpython.codeplex.com/workitem/28208
            AssertError(TypeError, nt.umask, 3.14)
        else:
            AreEqual(nt.umask(3.14), 0)

        for i in [0, 1, 5, int((2**(31))-1)]:
            AreEqual(nt.umask(i), 0)
            
        AssertError(OverflowError, nt.umask, 2**31)
        for i in [None,  "abc", 3j, int]:
            AssertError(TypeError, nt.umask, i)
        
    finally:
        nt.umask(orig)
Example #6
0
def test_umask():
    orig = nt.umask(0)
    try:
       
        if is_cpython: #http://ironpython.codeplex.com/workitem/28208
            AssertError(TypeError, nt.umask, 3.14)
        else:
            AreEqual(nt.umask(3.14), 0)

        for i in [0, 1, 5, int((2**(31))-1)]:
            AreEqual(nt.umask(i), 0)
            
        AssertError(OverflowError, nt.umask, 2**31)
        for i in [None,  "abc", 3j, int]:
            AssertError(TypeError, nt.umask, i)
        
    finally:
        nt.umask(orig)