예제 #1
0
 def test_invalid_octal_string_returns_default_and_warns(self):
     """A string with invalid octal should warn and return default."""
     found = decode_perms("999", None)
     self.assertIsNone(found)
     self.assertIn("WARNING: Undecodable", self.logs.getvalue())
예제 #2
0
 def test_integer(self):
     """A valid integer should return itself."""
     found = decode_perms(0o755, None)
     self.assertEqual(0o755, found)
예제 #3
0
 def test_valid_octal_string(self):
     """A string should be read as octal."""
     found = decode_perms("644", None)
     self.assertEqual(0o644, found)
예제 #4
0
 def test_none_returns_default(self):
     """If None is passed as perms, then default should be returned."""
     default = object()
     found = decode_perms(None, default)
     self.assertEqual(default, found)
 def test_invalid_octal_string_returns_default_and_warns(self):
     """A string with invalid octal should warn and return default."""
     found = decode_perms("999", None)
     self.assertIsNone(found)
     self.assertIn("WARNING: Undecodable", self.logs.getvalue())
 def test_valid_octal_string(self):
     """A string should be read as octal."""
     found = decode_perms("644", None)
     self.assertEqual(0o644, found)
 def test_integer(self):
     """A valid integer should return itself."""
     found = decode_perms(0o755, None)
     self.assertEqual(0o755, found)
 def test_none_returns_default(self):
     """If None is passed as perms, then default should be returned."""
     default = object()
     found = decode_perms(None, default)
     self.assertEqual(default, found)