summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2012-08-05 21:57:24 +0100
committerJonathan Lange <jml@canonical.com>2012-08-05 21:57:24 +0100
commit44497898c79cc5e9cf755158eb7c74e6ae1a508c (patch)
treee15eab3bb0e208eed54f2b67dff2b3ac39e22269
parent114770f7d858ca91c474f8f8d6f0e3735298d25e (diff)
downloadfixtures-44497898c79cc5e9cf755158eb7c74e6ae1a508c.tar.gz
Rename to 'join'.
-rw-r--r--NEWS2
-rw-r--r--lib/fixtures/_fixtures/tempdir.py2
-rw-r--r--lib/fixtures/tests/_fixtures/test_tempdir.py12
3 files changed, 8 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 544011e..a994487 100644
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ NEXT
CHANGES:
-* Add ``abspath`` method to ``TempDir`` to more readily get paths relative
+* Add ``join`` method to ``TempDir`` to more readily get paths relative
to a temporary directory. (Jonathan Lange)
diff --git a/lib/fixtures/_fixtures/tempdir.py b/lib/fixtures/_fixtures/tempdir.py
index b37a32b..663d3eb 100644
--- a/lib/fixtures/_fixtures/tempdir.py
+++ b/lib/fixtures/_fixtures/tempdir.py
@@ -44,7 +44,7 @@ class TempDir(fixtures.Fixture):
self.path = tempfile.mkdtemp(dir=self.rootdir)
self.addCleanup(shutil.rmtree, self.path, ignore_errors=True)
- def abspath(self, *children):
+ def join(self, *children):
"""Return an absolute path, given one relative to this ``TempDir``.
WARNING: This does not do any checking of ``children`` to make sure
diff --git a/lib/fixtures/tests/_fixtures/test_tempdir.py b/lib/fixtures/tests/_fixtures/test_tempdir.py
index cb0584e..d0def55 100644
--- a/lib/fixtures/tests/_fixtures/test_tempdir.py
+++ b/lib/fixtures/tests/_fixtures/test_tempdir.py
@@ -46,26 +46,26 @@ class TestTempDir(testtools.TestCase):
with fixture:
self.assertThat(fixture.path, StartsWith(root))
- def test_abspath(self):
+ def test_join(self):
temp_dir = self.useFixture(TempDir())
root = temp_dir.path
relpath = 'foo/bar/baz'
self.assertEqual(
- os.path.join(root, relpath), temp_dir.abspath(relpath))
+ os.path.join(root, relpath), temp_dir.join(relpath))
- def test_abspath_multiple_children(self):
+ def test_join_multiple_children(self):
temp_dir = self.useFixture(TempDir())
root = temp_dir.path
self.assertEqual(
os.path.join(root, 'foo', 'bar', 'baz'),
- temp_dir.abspath('foo', 'bar', 'baz'))
+ temp_dir.join('foo', 'bar', 'baz'))
- def test_abspath_naughty_children(self):
+ def test_join_naughty_children(self):
temp_dir = self.useFixture(TempDir())
root = temp_dir.path
self.assertEqual(
os.path.abspath(os.path.join(root, '..', 'bar', 'baz')),
- temp_dir.abspath('..', 'bar', 'baz'))
+ temp_dir.join('..', 'bar', 'baz'))
class NestedTempfileTest(testtools.TestCase):