def testAccess(self):
        """
        Test accesses with __getattr__ to the underlying TarFile.
        This test really should be done with assertRaises as a context manager
        which is only available in python 2.7
        """

        tb = UserTarball(name='default.tgz', logger=self.logger)

        try:
            tb.doesNotExist()
            self.fail('Did not raise AttributeError')
        except AttributeError:
            pass

        try:
            x = tb.doesNotExistEither
            self.fail('Did not raise AttributeError')
        except AttributeError:
            pass
Beispiel #2
0
    def testAccess(self):
        """
        Test accesses with __getattr__ to the underlying TarFile.
        This test really should be done with assertRaises as a context manager
        which is only available in python 2.7
        """

        tb = UserTarball(name='default.tgz', logger=self.logger)

        try:
            tb.doesNotExist()
            self.fail('Did not raise AttributeError')
        except AttributeError:
            pass

        try:
            x = tb.doesNotExistEither
            self.fail('Did not raise AttributeError')
        except AttributeError:
            pass