8000 Add failing test to reproduce #46 · scijava/jgo@b0595e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit b0595e4

Browse files
committed
Add failing test to reproduce #46
1 parent 20553f3 commit b0595e4

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

jgo/jgo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def split_endpoint_string(endpoint_string):
367367
return endpoint_strings
368368

369369
def endpoints_from_strings(endpoint_strings, shortcuts={}):
370+
_logger.debug('Creating endpoints from strings %s with shortcuts %s', endpoint_strings, shortcuts)
370371
return [Endpoint.parse_endpoint(expand_coordinate(ep, shortcuts=shortcuts)) for ep in endpoint_strings]
371372

372373
def coordinates_from_endpoints(endpoints):

tests/test_shortcut_expansion.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import jgo
2+
import pathlib
3+
import tempfile
4+
import unittest
5+
6+
import logging
7+
_logger = logging.getLogger(__name__)
8+
9+
class ExpansionTest(unittest.TestCase):
10+
11+
def test_groovy_issue_46(self):
12+
shortcuts = {'groovy': 'org.codehaus.groovy:groovy-groovysh:org.codehaus.groovy.tools.shell.Main+commons-cli:commons-cli:1.3.1'}
13+
14+
tmp_dir = tempfile.mkdtemp(prefix='jgo-test-cache-dir')
15+
m2_repo = pathlib.Path.home() / '.m2' / 'repository'
16+
17+
primary_endpoint, workspace = jgo.resolve_dependencies(
18+
'groovy',
19+
cache_dir = tmp_dir,
20+
m2_repo = m2_repo,
21+
update_cache = True,
22+
shortcuts = shortcuts,
23+
verbose = 1)
24+
_logger.debug('Got primary_endpoint %s and workspace %s', primary_endpoint, workspace)
25+
26+
27+
if __name__ == '__main__':
28+
logging.basicConfig(level=logging.DEBUG)
29+
unittest.main()

0 commit comments

Comments
 (0)
0