Пример #1
0
 def test_real_path(self):
     symlink = getattr(os, 'symlink', None)
     skipIf(symlink is None, "No symlink support")
     tempdir = self.mkdtemp()
     source = os.path.join(tempdir, 'source')
     self.touch(source)
     target = os.path.join(tempdir, 'target')
     symlink(source, target)
     self.assertThat(source, SamePath(target))
     self.assertThat(target, SamePath(source))
Пример #2
0
def requires_swift(test_case):
    """Decorator to flag a test case as being dependent on Swift.

    Swift-specific tests will be skipped unless the ZAQAR_TEST_SWIFT
    environment variable is set. If the variable is set, the tests will
    assume that Swift is accessible and configured properly.
    """

    reason = ('Skipping tests that require Swift. Ensure Swift is running '
              'and then set ZAQAR_TEST_SWIFT in order to enable tests '
              'that are specific to this storage backend. ')

    return testtools.skipIf(SKIP_SWIFT_TESTS, reason)(test_case)
Пример #3
0
def requires_redis(test_case):
    """Decorator to indicate that a test requires Redis.

    If the environment variable is set, the tests will assume that
    redis-server is running.
    """

    reason = ('Skipping tests that require Redis. Ensure '
              'redis-server is running on localhost and then set '
              'MARCONI_TEST_REDIS in order to enable tests '
              'that are specific to this storage backend. ')

    return testtools.skipIf(SKIP_REDIS_TESTS, reason)(test_case)
Пример #4
0
def requires_redis(test_case):
    """Decorator to flag a test case as being dependent on Redis.

    Redis-specific tests will be skipped unless the ZAQAR_TEST_REDIS
    environment variable is set. If the variable is set, the tests will
    assume that redis is running and listening on localhost.
    """

    reason = ('Skipping tests that require Redis. Ensure '
              'Redis is running on localhost and then set '
              'ZAQAR_TEST_REDIS in order to enable tests '
              'that are specific to this storage backend. ')

    return testtools.skipIf(SKIP_REDIS_TESTS, reason)(test_case)
Пример #5
0
def requires_mongodb(test_case):
    """Decorator to flag a test case as being dependent on MongoDB.

    MongoDB-specific tests will be skipped unless the ZAQAR_TEST_MONGODB
    environment variable is set. If the variable is set, the tests will
    assume that mongod is running and listening on localhost.
    """

    reason = ('Skipping tests that require MongoDB. Ensure '
              'mongod is running on localhost and then set '
              'ZAQAR_TEST_MONGODB in order to enable tests '
              'that are specific to this storage backend. ')

    return testtools.skipIf(SKIP_MONGODB_TESTS, reason)(test_case)