Browse Source

Test pydbus on GLib 2.40 (Ubuntu 14.04) too.

master
Linus Lewandowski 5 years ago
parent
commit
c54adfebd5
  1. 6
      .travis.yml
  2. 6
      pydbus/tests/context.py
  3. 11
      tests/py2.7-ubuntu-14.04.dockerfile
  4. 11
      tests/py3.4-ubuntu-14.04.dockerfile
  5. 18
      tests/run.sh

6
.travis.yml

@ -7,6 +7,12 @@ env:
- distribution: ubuntu
version: 16.04
python: 2.7
- distribution: ubuntu
version: 14.04
python: 3.4
- distribution: ubuntu
version: 14.04
python: 2.7
services:
- docker

6
pydbus/tests/context.py

@ -1,14 +1,12 @@
from pydbus import SessionBus
with SessionBus() as bus:
notifications = bus.get('.Notifications')
assert(notifications.Notify)
assert(bus.dbus.RequestName)
assert(bus.con is None)
with SessionBus() as bus:
notifications = bus.get('.Notifications')
assert(notifications.Notify)
assert(bus.dbus.RequestName)
assert(bus.con is None)

11
tests/py2.7-ubuntu-14.04.dockerfile

@ -0,0 +1,11 @@
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y dbus python-gi python-pip psmisc python-dev
RUN python2 --version
RUN pip2 install greenlet
ADD . /root/
RUN cd /root && python2 setup.py install
RUN /root/tests/run.sh python2 dontpublish

11
tests/py3.4-ubuntu-14.04.dockerfile

@ -0,0 +1,11 @@
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y dbus python3-gi python3-pip psmisc python3-dev
RUN python3 --version
RUN pip3 install greenlet
ADD . /root/
RUN cd /root && python3 setup.py install
RUN /root/tests/run.sh python3 dontpublish

18
tests/run.sh

@ -15,14 +15,20 @@ rm "$ADDRESS_FILE" "$PID_FILE"
PYTHON=${1:-python}
"$PYTHON" -m pydbus.examples.notifications_server &
NOTIF_PID=$!
trap 'kill -TERM $PID $NOTIF_PID' EXIT
if [ "$2" != "dontpublish" ]
then
"$PYTHON" -m pydbus.examples.notifications_server &
NOTIF_PID=$!
trap 'kill -TERM $PID $NOTIF_PID' EXIT
fi
sleep 1
"$PYTHON" -m pydbus.tests.context
"$PYTHON" -m pydbus.tests.identifier
"$PYTHON" -m pydbus.tests.publish
"$PYTHON" -m pydbus.tests.publish_properties
"$PYTHON" -m pydbus.tests.publish_multiface
if [ "$2" != "dontpublish" ]
then
"$PYTHON" -m pydbus.tests.publish
"$PYTHON" -m pydbus.tests.publish_properties
"$PYTHON" -m pydbus.tests.publish_multiface
fi

Loading…
Cancel
Save