2018-02-27 13:37:11 +00:00
|
|
|
|
|
|
|
import unittest2
|
|
|
|
|
|
|
|
import ansible_mitogen.helpers
|
|
|
|
import testlib
|
|
|
|
|
|
|
|
|
|
|
|
class ApplyModeSpecTest(unittest2.TestCase):
|
2018-03-08 21:36:56 +00:00
|
|
|
func = staticmethod(ansible_mitogen.helpers.apply_mode_spec)
|
2018-02-27 13:37:11 +00:00
|
|
|
|
|
|
|
def test_simple(self):
|
|
|
|
spec = 'u+rwx,go=x'
|
|
|
|
self.assertEquals(0711, self.func(spec, 0))
|
|
|
|
|
|
|
|
spec = 'g-rw'
|
|
|
|
self.assertEquals(0717, self.func(spec, 0777))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest2.main()
|