-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from minsis/master
Added http auth to client
- Loading branch information
Showing
5 changed files
with
50 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,4 +101,7 @@ ENV/ | |
.pytest_cache/ | ||
|
||
Pipfile.lock | ||
.vscode/ | ||
.vscode/ | ||
|
||
# IDE editors | ||
.idea |
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
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,27 @@ | ||
from jolokia.api import JolokiaClient | ||
from tests.base import JolokiaTestCase | ||
from requests.exceptions import ConnectionError | ||
|
||
import logging | ||
import pytest | ||
|
||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class TestAPI(JolokiaTestCase): | ||
|
||
def test_unresolvable_agent(self): | ||
|
||
self.jc = JolokiaClient('http://trythelandcrab.com', 'myuser', 'mypasswd') | ||
|
||
kwargs = {'mbean': 'java.lang:Memory', 'attribute': 'HeapMemoryUsage'} | ||
pytest.raises(ConnectionError, self.jc.get_attribute, **kwargs) | ||
|
||
def test_missing_agent(self): | ||
|
||
self.jc = JolokiaClient('http://google.com', 'myuser', 'mypasswd') | ||
kwargs = {'mbean': 'java.lang:Memory', 'attribute': 'HeapMemoryUsage'} | ||
resp = self.jc.get_attribute(**kwargs) | ||
|
||
assert resp.status_code != 200 |