Skip to content

Commit 04e7fbc

Browse files
committed
Further test fixes
1 parent fd36c18 commit 04e7fbc

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

mbed/mbed.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,9 @@ def isurl(cls, url):
11331133

11341134
@classmethod
11351135
def isinsecure(cls, url):
1136+
path = re.sub(r'^(.+)[#?].*$', r'\1', url)
1137+
if os.path.isdir(path): # local paths are secure
1138+
return False
11361139
up = urlparse(url)
11371140
return (not up) or (up.scheme and up.scheme not in ['http', 'https', 'ssh', 'git']) or (up.port and int(up.port) not in [22, 80, 443])
11381141

test/add_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_add(mbed, testrepos):
2020
popen(['python', mbed, 'add', test3, "-vv"])
2121

2222
assertls(mbed, 'test1', [
23-
"*",
23+
"[mbed]",
2424
"test1",
2525
"|- test2",
2626
"| `- test3",
@@ -38,7 +38,7 @@ def test_import_after_add(mbed, testrepos):
3838
popen(['python', mbed, 'import', test1, 'testimport', "-vv"])
3939

4040
assertls(mbed, 'testimport', [
41-
"*",
41+
"[mbed]",
4242
"testimport",
4343
"|- test2",
4444
"| `- test3",

test/import_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_import(mbed, testrepos):
1818
popen(['python', mbed, 'import', test1, 'testimport'])
1919

2020
assertls(mbed, 'testimport', [
21-
"*",
21+
"[mbed]",
2222
"testimport",
2323
"`- test2",
2424
" `- test3",

test/ls_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Tests 'mbed ls' and provides sanity check of test framework
1616
def test_ls(mbed, testrepos):
1717
assertls(mbed, 'test1', [
18-
"*",
18+
"[mbed]",
1919
"test1",
2020
"`- test2",
2121
" `- test3",

test/remove_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_remove(mbed, testrepos):
1818
popen(['python', mbed, 'remove', 'test2'])
1919

2020
assertls(mbed, 'test1', [
21-
"*",
21+
"[mbed]",
2222
"test1",
2323
])
2424

@@ -31,6 +31,6 @@ def test_import_after_remove(mbed, testrepos):
3131
popen(['python', mbed, 'import', test1, 'testimport'])
3232

3333
assertls(mbed, 'testimport', [
34-
"*",
34+
"[mbed]",
3535
"testimport",
3636
])

test/sync_update_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_sync_update_remove(mbed, testrepos):
5151
popen(['python', mbed, 'update', '-vv'])
5252

5353
assertls(mbed, 'testimport', [
54-
"*",
54+
"[mbed]",
5555
"testimport",
5656
"`- test2",
5757
])
@@ -74,7 +74,7 @@ def test_sync_update_add(mbed, testrepos):
7474
popen(['python', mbed, 'update', '-vv'])
7575

7676
assertls(mbed, 'testimport', [
77-
"*",
77+
"[mbed]",
7878
"testimport",
7979
"`- test2",
8080
" |- test3",
@@ -101,7 +101,7 @@ def test_sync_update_move(mbed, testrepos):
101101
popen(['python', mbed, 'update', '-vv'])
102102

103103
assertls(mbed, 'testimport', [
104-
"*",
104+
"[mbed]",
105105
"testimport",
106106
"`- test2",
107107
" `- testmove",

0 commit comments

Comments
 (0)