summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--magic.py2
-rwxr-xr-xtest/test.py8
2 files changed, 3 insertions, 7 deletions
diff --git a/magic.py b/magic.py
index a4729e6..73f3a1a 100644
--- a/magic.py
+++ b/magic.py
@@ -300,7 +300,7 @@ _magic_getparam.errcheck = errorcheck_negative_one
def magic_getparam(cookie, param):
val = c_size_t()
_magic_getparam(cookie, param, byref(val))
- return val
+ return val.value
MAGIC_NONE = 0x000000 # No flags
MAGIC_DEBUG = 0x000001 # Turn on debugging
diff --git a/test/test.py b/test/test.py
index 54ffe32..ab29def 100755
--- a/test/test.py
+++ b/test/test.py
@@ -125,13 +125,9 @@ class MagicTest(unittest.TestCase):
magic.magic_buffer = old
def test_getparam(self):
- filename = os.path.join(self.TESTDATA_DIR, 'keep-going.jpg')
-
m = magic.Magic(mime=True)
- self.assertEqual(m.getparam(magic.MAGIC_PARAM_BYTES_MAX).value, 1048576)
- m.setparam(magic.MAGIC_PARAM_BYTES_MAX, 1)
- self.assertEqual(m.getparam(magic.MAGIC_PARAM_BYTES_MAX).value, 1)
- self.assertEqual(m.from_file(filename), 'application/octet-stream')
+ m.setparam(magic.MAGIC_PARAM_INDIR_MAX, 1)
+ self.assertEqual(m.getparam(magic.MAGIC_PARAM_INDIR_MAX), 1)
if __name__ == '__main__':
unittest.main()