/usr/lib/python2.7/dist-packages/pint/testsuite/test_errors.py is in python-pint 0.8.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # -*- coding: utf-8 -*-
from __future__ import division, unicode_literals, print_function, absolute_import
from pint.errors import DimensionalityError, UndefinedUnitError
from pint.testsuite import BaseTestCase
class TestErrors(BaseTestCase):
def test_errors(self):
x = ('meter', )
msg = "'meter' is not defined in the unit registry"
self.assertEqual(str(UndefinedUnitError(x)), msg)
self.assertEqual(str(UndefinedUnitError(list(x))), msg)
self.assertEqual(str(UndefinedUnitError(set(x))), msg)
msg = "Cannot convert from 'a' (c) to 'b' (d)msg"
ex = DimensionalityError('a', 'b', 'c', 'd', 'msg')
self.assertEqual(str(ex), msg)
|