Skip to content
Browse files

Test tweaks for non-git environments.

Why you'd be developing Fabric without Git installed, I have no idea. I
guess for those users who like grabbing tarballs and running the test
suite (valid, just unusual).
  • Loading branch information...
1 parent 96732b3 commit 93c3b1546cb3e13b3408846a714d1a1b98cf6a0d @bitprophet bitprophet committed Jun 18, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 tests/test_version.py
View
7 tests/test_version.py
@@ -9,16 +9,17 @@
def test_get_version():
get_version = fabric.version.get_version
- sha1 = "(%s)" % fabric.version.git_sha()
+ sha = fabric.version.git_sha()
+ sha1 = (" (%s)" % sha) if sha else ""
for tup, short, normal, verbose in [
((0, 9, 0, 'final', 0), '0.9.0', '0.9', '0.9 final'),
((0, 9, 1, 'final', 0), '0.9.1', '0.9.1', '0.9.1 final'),
((0, 9, 0, 'alpha', 1), '0.9a1', '0.9 alpha 1', '0.9 alpha 1'),
((0, 9, 1, 'beta', 1), '0.9.1b1', '0.9.1 beta 1', '0.9.1 beta 1'),
((0, 9, 0, 'release candidate', 1),
'0.9rc1', '0.9 release candidate 1', '0.9 release candidate 1'),
- ((1, 0, 0, 'alpha', 0), '1.0a %s' % sha1, '1.0 pre-alpha %s' % sha1,
- '1.0 pre-alpha %s' % sha1),
+ ((1, 0, 0, 'alpha', 0), '1.0a%s' % sha1, '1.0 pre-alpha%s' % sha1,
+ '1.0 pre-alpha%s' % sha1),
]:
fabric.version.VERSION = tup
yield eq_, get_version('short'), short

0 comments on commit 93c3b15

Please sign in to comment.
Something went wrong with that request. Please try again.