Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
7cae5c3c
Commit
7cae5c3c
authored
Apr 12, 2015
by
Artur Malabarba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* test/automated/package-test.el: Test async functionality
(package-test-update-archives-async): New test
parent
ccade56f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
test/automated/data/package/package-test-server.py
test/automated/data/package/package-test-server.py
+21
-0
test/automated/package-test.el
test/automated/package-test.el
+29
-1
No files found.
test/automated/data/package/package-test-server.py
0 → 100644
View file @
7cae5c3c
import
sys
import
BaseHTTPServer
from
SimpleHTTPServer
import
SimpleHTTPRequestHandler
HandlerClass
=
SimpleHTTPRequestHandler
ServerClass
=
BaseHTTPServer
.
HTTPServer
Protocol
=
"HTTP/1.0"
if
sys
.
argv
[
1
:]:
port
=
int
(
sys
.
argv
[
1
])
else
:
port
=
8000
server_address
=
(
'127.0.0.1'
,
port
)
HandlerClass
.
protocol_version
=
Protocol
httpd
=
ServerClass
(
server_address
,
HandlerClass
)
sa
=
httpd
.
socket
.
getsockname
()
print
"Serving HTTP on"
,
sa
[
0
],
"port"
,
sa
[
1
],
"..."
httpd
.
serve_forever
()
test/automated/package-test.el
View file @
7cae5c3c
...
...
@@ -103,6 +103,7 @@
(
cl-defmacro
with-package-test
((
&optional
&key
file
basedir
install
location
update-news
upload-base
)
&rest
body
)
...
...
@@ -112,7 +113,7 @@
(
process-environment
(
cons
(
format
"HOME=%s"
package-test-user-dir
)
process-environment
))
(
package-user-dir
package-test-user-dir
)
(
package-archives
`
((
"gnu"
.
,
package-test-data-dir
)))
(
package-archives
`
((
"gnu"
.
,
(
or
,
location
package-test-data-dir
)
)))
(
default-directory
package-test-file-dir
)
abbreviated-home-dir
package--initialized
...
...
@@ -336,6 +337,33 @@ Must called from within a `tar-mode' buffer."
(
package-menu-refresh
)
(
should
(
package-installed-p
'simple-single
'
(
1
4
)))))))
(
ert-deftest
package-test-update-archives-async
()
"Test updating package archives asynchronously."
(
skip-unless
(
executable-find
"python2"
))
(
with-package-test
(
:basedir
package-test-data-dir
:location
"http://0.0.0.0:8000/"
)
(
let*
((
package-menu-async
t
)
(
process
(
start-process
"package-server"
"package-server-buffer"
(
executable-find
"python2"
)
(
expand-file-name
"package-test-server.py"
))))
(
unwind-protect
(
progn
(
list-packages
)
(
should
package--downloads-in-progress
)
(
should
mode-line-process
)
(
should-not
(
string=
(
format-mode-line
mode-line-process
)
""
))
(
should-not
(
with-timeout
(
10
'timeout
)
(
while
package--downloads-in-progress
(
accept-process-output
nil
1
))
nil
))
(
goto-char
(
point-min
))
(
should
(
search-forward-regexp
"^ +simple-single"
nil
t
)))
(
kill-process
process
)))))
(
ert-deftest
package-test-describe-package
()
"Test displaying help for a package."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment