diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_git_command.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/test_git_command.py b/tests/test_git_command.py index 4d65d3ce..5ceb0b33 100644 --- a/tests/test_git_command.py +++ b/tests/test_git_command.py | |||
| @@ -50,12 +50,20 @@ class GitCallUnitTest(unittest.TestCase): | |||
| 50 | self.assertNotEqual('', ver.full) | 50 | self.assertNotEqual('', ver.full) |
| 51 | 51 | ||
| 52 | 52 | ||
| 53 | class RepoUserAgentUnitTest(unittest.TestCase): | 53 | class UserAgentUnitTest(unittest.TestCase): |
| 54 | """Tests the RepoUserAgent function.""" | 54 | """Tests the UserAgent function.""" |
| 55 | 55 | ||
| 56 | def test_smoke(self): | 56 | def test_smoke_os(self): |
| 57 | """Make sure it returns something useful.""" | 57 | """Make sure UA OS setting returns something useful.""" |
| 58 | ua = git_command.RepoUserAgent() | 58 | os_name = git_command.user_agent.os |
| 59 | # We can't dive too deep because of OS/tool differences, but we can check | ||
| 60 | # the general form. | ||
| 61 | m = re.match(r'^[^ ]+$', os_name) | ||
| 62 | self.assertIsNotNone(m) | ||
| 63 | |||
| 64 | def test_smoke_repo(self): | ||
| 65 | """Make sure repo UA returns something useful.""" | ||
| 66 | ua = git_command.user_agent.repo | ||
| 59 | # We can't dive too deep because of OS/tool differences, but we can check | 67 | # We can't dive too deep because of OS/tool differences, but we can check |
| 60 | # the general form. | 68 | # the general form. |
| 61 | m = re.match(r'^git-repo/[^ ]+ ([^ ]+) git/[^ ]+ Python/[0-9.]+', ua) | 69 | m = re.match(r'^git-repo/[^ ]+ ([^ ]+) git/[^ ]+ Python/[0-9.]+', ua) |
