Permalink
Browse files

Rename config() method to data().

  • Loading branch information...
1 parent 8f59cce commit 26e3cd0ac7fa4b4c2f2be30128ccb7a6b4b556a0 @djl committed Feb 7, 2013
Showing with 11 additions and 11 deletions.
  1. +11 −11 tests/tests.py
View
@@ -10,10 +10,10 @@ class Base(unittest.TestCase):
commands = ['../bin/vcprompt']
- def config(self, field):
+ def data(self, field):
"""
Returns the value for the given ``field`` from the
- configuration file.
+ 'tests/data' directory for each repository.
"""
location = os.path.abspath(__file__).rsplit('/', 1)[0]
location = os.path.join(location, 'data', self.repository, field)
@@ -86,33 +86,33 @@ def test_format_all(self, string='%s:%n:%r:%h:%b'):
Tests that all formatting arguments are working correctly.
"""
output = self.vcprompt(format=string)
- expected = ':'.join([self.config('system'),
- self.config('system'),
- self.config('revision'),
- self.config('hash'),
- self.config('branch')])
+ expected = ':'.join([self.data('system'),
+ self.data('system'),
+ self.data('revision'),
+ self.data('hash'),
+ self.data('branch')])
self.assertEqual(output, expected)
def test_format_branch(self, string='%b'):
"""
Tests that the correct branch name is returned.
"""
output = self.vcprompt(format=string)
- self.assertEqual(output, self.config('branch'))
+ self.assertEqual(output, self.data('branch'))
def test_format_revision(self, string='%r'):
"""
Tests that the correct revision ID or hash is returned.
"""
output = self.vcprompt(format=string)
- self.assertEqual(output, self.config('revision'))
+ self.assertEqual(output, self.data('revision'))
def test_format_hash(self, string='%h'):
"""
Tests that the correct hash or revision ID is returned.
"""
self.assertEqual(self.vcprompt(format=string),
- self.config('hash'))
+ self.data('hash'))
def test_format_modified(self, string='%m'):
"""
@@ -138,7 +138,7 @@ def test_format_system(self, string='%s'):
Tests that the '%s' argument correctly returns the system name.
"""
output = self.vcprompt(format=string)
- self.assertEqual(output, self.config('system'))
+ self.assertEqual(output, self.data('system'))
def test_format_system_alt(self, string='%n'):
"""

0 comments on commit 26e3cd0

Please sign in to comment.