forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Literal `credentials` lost test coverage (had none to start with) when the pants repo switched to `netrc_credentials`. Add coverage, and fix exposed issues. Testing Done: https://travis-ci.org/pantsbuild/pants/builds/119377185 Bugs closed: 3113 Reviewed at https://rbcommons.com/s/twitter/r/3624/
- Loading branch information
Showing
4 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/python/pants_test/backend/jvm/targets/test_credentials.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# coding=utf-8 | ||
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, | ||
unicode_literals, with_statement) | ||
|
||
from pants.backend.jvm.targets.credentials import LiteralCredentials | ||
from pants_test.base_test import BaseTest | ||
|
||
|
||
class CredentialsTest(BaseTest): | ||
|
||
def test_literal_declaration(self): | ||
username = 'please don`t ever do this.' | ||
password = 'seriously, don`t.' | ||
t = self.make_target(':creds', LiteralCredentials, username=username, password=password) | ||
|
||
self.assertEquals(t.username('anything'), username) | ||
self.assertEquals(t.password('anything'), password) |