Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
127 additions
and
8 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"author" : "Keith Derrick", | ||
"email" : "kderrick_public@att.net", | ||
"version" : "0.1.2" | ||
"version" : "0.1.3" | ||
} |
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,53 @@ | ||
import pytest | ||
import os | ||
|
||
import gerritssh as gssh | ||
import logging | ||
|
||
logging.basicConfig(level=logging.CRITICAL) | ||
|
||
|
||
def online_instance(): | ||
return os.getenv('GSSH_TEST_INSTANCE', '') | ||
|
||
|
||
pytestmark = pytest.mark.skipif(online_instance() == '', | ||
reason=('No live Gerrit instance ' | ||
'in environment')) | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def live_instance(request): | ||
s = gssh.Site(online_instance()) | ||
|
||
def fin(): | ||
print('Closing connection to ' + online_instance()) | ||
s.disconnect() | ||
|
||
print('Site created: ' + repr(s)) | ||
request.addfinalizer(fin) | ||
s.connect() | ||
assert s.connected | ||
return s | ||
|
||
|
||
def test_ol_version(live_instance): | ||
assert str(live_instance.version) != '0.0.0' | ||
|
||
|
||
def test_ol_lp(live_instance): | ||
lp = gssh.ProjectList() | ||
lp.execute_on(live_instance) | ||
|
||
assert len(lp.results) > 0 | ||
|
||
|
||
def test_ol_query(live_instance): | ||
log = logging.getLogger('test_ol_query') | ||
log.setLevel(logging.DEBUG) | ||
log.debug('Launching Query') | ||
q = gssh.Query(query='status:open', max_results=3) | ||
qresults = q.execute_on(live_instance) | ||
log.debug('Query Done {0}'.format(qresults)) | ||
assert qresults != [] | ||
assert len(qresults) <= 3 |