Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename config() method to data().
  • Loading branch information
djl committed Feb 7, 2013
1 parent 8f59cce commit 26e3cd0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/tests.py
Expand Up @@ -10,10 +10,10 @@ class Base(unittest.TestCase):


commands = ['../bin/vcprompt'] commands = ['../bin/vcprompt']


def config(self, field): def data(self, field):
""" """
Returns the value for the given ``field`` from the 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.abspath(__file__).rsplit('/', 1)[0]
location = os.path.join(location, 'data', self.repository, field) location = os.path.join(location, 'data', self.repository, field)
Expand Down Expand Up @@ -86,33 +86,33 @@ def test_format_all(self, string='%s:%n:%r:%h:%b'):
Tests that all formatting arguments are working correctly. Tests that all formatting arguments are working correctly.
""" """
output = self.vcprompt(format=string) output = self.vcprompt(format=string)
expected = ':'.join([self.config('system'), expected = ':'.join([self.data('system'),
self.config('system'), self.data('system'),
self.config('revision'), self.data('revision'),
self.config('hash'), self.data('hash'),
self.config('branch')]) self.data('branch')])
self.assertEqual(output, expected) self.assertEqual(output, expected)


def test_format_branch(self, string='%b'): def test_format_branch(self, string='%b'):
""" """
Tests that the correct branch name is returned. Tests that the correct branch name is returned.
""" """
output = self.vcprompt(format=string) output = self.vcprompt(format=string)
self.assertEqual(output, self.config('branch')) self.assertEqual(output, self.data('branch'))


def test_format_revision(self, string='%r'): def test_format_revision(self, string='%r'):
""" """
Tests that the correct revision ID or hash is returned. Tests that the correct revision ID or hash is returned.
""" """
output = self.vcprompt(format=string) output = self.vcprompt(format=string)
self.assertEqual(output, self.config('revision')) self.assertEqual(output, self.data('revision'))


def test_format_hash(self, string='%h'): def test_format_hash(self, string='%h'):
""" """
Tests that the correct hash or revision ID is returned. Tests that the correct hash or revision ID is returned.
""" """
self.assertEqual(self.vcprompt(format=string), self.assertEqual(self.vcprompt(format=string),
self.config('hash')) self.data('hash'))


def test_format_modified(self, string='%m'): def test_format_modified(self, string='%m'):
""" """
Expand All @@ -138,7 +138,7 @@ def test_format_system(self, string='%s'):
Tests that the '%s' argument correctly returns the system name. Tests that the '%s' argument correctly returns the system name.
""" """
output = self.vcprompt(format=string) 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'): def test_format_system_alt(self, string='%n'):
""" """
Expand Down

0 comments on commit 26e3cd0

Please sign in to comment.